From: | Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Julien Rouhaud <julien(dot)rouhaud(at)dalibo(dot)com>, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, Guillaume Lelarge <guillaume(at)lelarge(dot)info>, mail(at)bwe(dot)im, Oleksandr Shulgin <oleksandr(dot)shulgin(at)zalando(dot)de>, PostgreSQL Bugs List <pgsql-bugs(at)postgresql(dot)org> |
Subject: | Re: BUG #12379: pgbench should hint to pgbench -i |
Date: | 2015-07-18 22:48:36 |
Message-ID: | 20150718224836.GB2301@postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2015-07-19 15:20:09 | Re: Lack of Sanity Checking in file 'pctcl.c' for PostgreSQL 9.4.x |
Previous Message | Alvaro Herrera | 2015-07-18 20:19:15 | Re: Lack of Sanity Checking in file 'pctcl.c' for PostgreSQL 9.4.x |