Re: BUG #12379: pgbench should hint to pgbench -i - Mailing list pgsql-bugs

From Alvaro Herrera
Subject Re: BUG #12379: pgbench should hint to pgbench -i
Date
Msg-id 20150718224836.GB2301@postgresql.org
Whole thread Raw
In response to Re: BUG #12379: pgbench should hint to pgbench -i  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Tom Lane wrote:

> You could imagine including errcodes.h by itself after supplying a
> suitable definition for MAKE_SQLSTATE(); but I think you'd want it to
> reconstitute the five characters into a string literal, and I'm not
> sure that there's any easy way to do that in C.  If we wanted to
> go in this direction, it might be easier to create another Perl
> script that puts out an errcodes-fe.h with the errcode symbols
> #defined as string literals.
>
> The larger reason we've not done this is that, once a given errcode
> is wired into some client-side code, it effectively becomes part of
> the protocol and can't be reassigned.  See the comments around the
> places in libpq where specific errcodes are referenced.  So it's
> not very clear that we want to encourage frontend code to use this
> technique a lot.

Maybe we could mark individual errcodes in errcodes.txt as "exported for
clients" with some new token, and the new errcodes-fe.h list would only
include those.  That way, we only fix a limited number of codes instead
of all of them.

We could add such marks to all codes defined by the standard, since we
can't change those anyway.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

pgsql-bugs by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Lack of Sanity Checking in file 'pctcl.c' for PostgreSQL 9.4.x
Next
From: Tobias Pfeiffer
Date:
Subject: Re: BUG #13504: Types in math functions table is incorrect