Re: [PATCH] psql: Display SQLSTATE macro name in verbose error reports

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: jian he <jian(dot)universality(at)gmail(dot)com>
Cc: Aaryan Parik <aaryanparik124(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] psql: Display SQLSTATE macro name in verbose error reports
Date: 2026-05-25 19:20:23
Message-ID: 137426.1779736823@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

jian he <jian(dot)universality(at)gmail(dot)com> writes:
> On Sun, May 24, 2026 at 3:18 AM Aaryan Parik <aaryanparik124(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message SATYANARAYANA NARLAPURAM 2026-05-25 19:01:37 Re: [PATCH] Release replication slot on error in SQL-callable slot functions