Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZGavB-0003fS-U7 for pgsql-bugs@arkaria.postgresql.org; Sat, 18 Jul 2015 22:49:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZGavB-0003bi-8f for pgsql-bugs@arkaria.postgresql.org; Sat, 18 Jul 2015 22:49:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZGauZ-0002vC-QC for pgsql-bugs@postgresql.org; Sat, 18 Jul 2015 22:48:51 +0000 Received: from smtp-auth.no-ip.com ([8.23.224.61] helo=out.smtp-auth.no-ip.com) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZGauS-0004qk-93 for pgsql-bugs@postgresql.org; Sat, 18 Jul 2015 22:48:51 +0000 X-No-IP: alvh.no-ip.org@noip-smtp X-Report-Spam-To: abuse@no-ip.com Received: from alvin.alvh.no-ip.org (unknown [195.39.71.250]) (Authenticated sender: alvh.no-ip.org@noip-smtp) by smtp-auth.no-ip.com (Postfix) with ESMTPA id 3F42C4007A4; Sat, 18 Jul 2015 15:48:38 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 964FFC2B; Sun, 19 Jul 2015 02:48:36 +0400 (SAMT) Date: Sun, 19 Jul 2015 00:48:36 +0200 From: Alvaro Herrera To: Tom Lane Cc: Julien Rouhaud , Fabien COELHO , Guillaume Lelarge , mail@bwe.im, Oleksandr Shulgin , PostgreSQL Bugs List Subject: Re: BUG #12379: pgbench should hint to pgbench -i Message-ID: <20150718224836.GB2301@postgresql.org> References: <55984046.60901@dalibo.com> <559908D4.7020901@dalibo.com> <23314.1436142811@sss.pgh.pa.us> <55AA32E0.7070006@dalibo.com> <55AA7BC9.6090307@dalibo.com> <11036.1437237151@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <11036.1437237151@sss.pgh.pa.us> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -1.8 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs