Re: [HACKERS] psql - add special variable to reflect the last query status - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] psql - add special variable to reflect the last query status
Date
Msg-id 10693.1505152972@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] psql - add special variable to reflect the last querystatus  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: [HACKERS] psql - add special variable to reflect the last querystatus
List pgsql-hackers
Fabien COELHO <coelho@cri.ensmp.fr> writes:
>> I think you're overly optimistic to believe that every failure will
>> have a SQLSTATE; I don't think that's true for libpq-reported errors,
>> such as connection loss.

> Yep, I thought I was optimistic:-) Can I add a special SQLSTATE for that 
> situation where libpq did not report an error?

Meh.  If we're going to do that I think it might be better to hack
libpq itself to do so, ie, force PQresultErrorField(..., PG_DIAG_SQLSTATE)
to always return something.  But it seems like a hack either way.
        regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] pgbench tap tests & minor fixes.
Next
From: Peter Eisentraut
Date:
Subject: [HACKERS] Re: DROP SUBSCRIPTION hangs if sub is disabled in the sametransaction