Re: [PATCH] psql: Display SQLSTATE macro name in verbose error reports - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCH] psql: Display SQLSTATE macro name in verbose error reports
Date
Msg-id 137426.1779736823@sss.pgh.pa.us
Whole thread
In response to Re: Allow a condition string in an injection point  (Bertrand Drouvot <bertranddrouvot.pg@gmail.com>)
List pgsql-hackers
jian he <jian.universality@gmail.com> writes:
> On Sun, May 24, 2026 at 3:18 AM Aaryan Parik <aaryanparik124@gmail.com> wrote:
>> Example output:
>> ERROR:  42601: syntax error at or near "FRO"
>> LINE 1: SELECT * FRO;
>> ^
>> LOCATION:  scanner_yyerror, scan.l:1220
>> SQLSTATE name: ERRCODE_SYNTAX_ERROR

> This seems identical to the patch submitted in the previous email thread, [0].

It's not exactly the same: Josh's patch did the dirty work in libpq
not psql.  So this has a somewhat smaller blast radius for client
compatibility problems (but still not zero).  The other comments
I posted in the other thread still apply though.

            regards, tom lane



pgsql-hackers by date:

Previous
From: SATYANARAYANA NARLAPURAM
Date:
Subject: Re: [PATCH] Release replication slot on error in SQL-callable slot functions
Next
From: Paul Ramsey
Date:
Subject: Re: Add --extra-dependencies and immediate data dumping for pg_dump/pg_upgrade