Improve PL/Tcl errorCode facility by providing decoded name for SQLSTATE.
Tom Lane <tgl@sss.pgh.pa.us>
Improve PL/Tcl errorCode facility by providing decoded name for SQLSTATE. We don't really want to encourage people to write numeric SQLSTATEs in programs; that's unreadable and error-prone. Copy plpgsql's infrastructure for converting between SQLSTATEs and exception names shown in Appendix A, and modify examples in tests and documentation to do it that way.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/pltcl.sgml | modified | +6 −4 |
| src/backend/utils/errcodes.txt | modified | +3 −0 |
| src/pl/tcl/expected/pltcl_setup.out | modified | +5 −5 |
| src/pl/tcl/generate-pltclerrcodes.pl | added | +40 −0 |
| src/pl/tcl/.gitignore | modified | +2 −0 |
| src/pl/tcl/Makefile | modified | +13 −2 |
| src/pl/tcl/pltcl.c | modified | +36 −0 |
| src/pl/tcl/sql/pltcl_setup.sql | modified | +2 −2 |
| src/tools/msvc/Solution.pm | modified | +11 −0 |