Re: autogenerating error code lists (was Re: [COMMITTERS] pgsql: Add foreign data wrapper error code values for SQL/MED.)
Jan Urbański <wulczer@wulczer.org>
From: Jan Urbański <wulczer@wulczer.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>, pgsql-hackers@postgresql.org, Shigeru HANADA <hanada@metrosystems.co.jp>
Date: 2010-12-28T11:25:48Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Add foreign data wrapper error code values for SQL/MED.
- 85cff3ce7f36 9.1.0 cited
Attachments
- errcodes.txt (text/plain)
- generate-errcodes.pl (text/x-perl)
- generate-plerrcodes.pl (text/x-perl)
- generate-errcodes-table.pl (text/x-perl)
On 26/12/10 21:33, Jan Urbański wrote: > On 26/12/10 21:17, Tom Lane wrote: >> =?UTF-8?B?SmFuIFVyYmHFhHNraQ==?= <wulczer@wulczer.org> writes: >>> Makes sense. Wait, no, errcodes.sgml includes the entries for success >>> and warnings, but the plpgsql conditions list does not. So we need a >>> separate column to differentiate. >> >> OK. But not 0/1 please. Maybe 'E', 'W', or 'S' ? And again, fixed >> width columns first, so something like >> >> sqlstate E/W/S errcode_macro_name plpgsql_condition_name >> >> where I guess we could still make the plpgsql condition name optional. > > All right, E/W/S sounds good. I'm actually faulty of a misnomer by > calling the field plpgsql_condition_name. It's more like spec_name, and > it will be used to generate plpgsql condition names for E entries and > rows in errcodes.sgml for all entries. > > Remember that there will also be Section: lines there, because > errcodes.sgml needs to know where particular the error classes start and > end. Here's the basic errcodes.txt file and three scripts to generate errcodes.h, plerrcodes.h and part of errcodes.sgml. I tried wiring it into the build system, but failed, I can't figure out which Makefiles should be updated in order to make errcodes.h and plerrcodes.h generated headers. Could someone help with that? This will actually remove a few entries from plerrcodes.h, that were aliases of other entries (like array_element_error which was an alias of array_subscript_error). Since they did not appear in errcodes.sgml, it shouldn't be a problem. It also adds a forgotten entry for nonstandard_use_of_escape_character in plerrcodes.h. Cheers, Jan