mirror of
https://github.com/postgres/postgres.git
synced 2025-07-15 19:21:59 +03:00
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.
This commit is contained in:
@ -350,6 +350,17 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY
|
||||
);
|
||||
}
|
||||
|
||||
if ($self->{options}->{tcl}
|
||||
&& IsNewer(
|
||||
'src/pl/tcl/pltclerrcodes.h',
|
||||
'src/backend/utils/errcodes.txt'))
|
||||
{
|
||||
print "Generating pltclerrcodes.h...\n";
|
||||
system(
|
||||
'perl src/pl/tcl/generate-pltclerrcodes.pl src/backend/utils/errcodes.txt > src/pl/tcl/pltclerrcodes.h'
|
||||
);
|
||||
}
|
||||
|
||||
if (IsNewer(
|
||||
'src/backend/utils/sort/qsort_tuple.c',
|
||||
'src/backend/utils/sort/gen_qsort_tuple.pl'))
|
||||
|
Reference in New Issue
Block a user