On 28/12/10 12:25, Jan Urbański wrote: > 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?
Trying a bit harder to make src/include/utils/errcodes.h a generated file I found that it's included so early it makes the task not trivial at all. postgres.h includes elog.h, which includes errcodes.h (after defining the MAKE_SQLSTATE macro). I'm not sure how to proceed: 1) just give up on it, and keep on maintaining 3 places where new error codes have to go 2) do not include errcodes.h in elog.h, move the MAKE_SQLSTATE definition to the top of errcodes.h, guarded by a #ifndef MAKE_SQLSTATE, fix every place that included elog.h and assumed it has the sqlstate values to explicitly include errcodes.h. This means that you can still define your own MAKE_SQLSTATE macro and then include errcodes.h if you want to redefine what it does. 3) try to wire generating errcodes.h somewhere very early in the makefiles My preference is 2) followed by 1), because 3) seems too horrible. But I can understand if people will want to keep things as they are and just forget about generating errcodes.h Cheers, Jan -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers