Re: [proposal] Add an option for returning SQLSTATE in psql error message - Mailing list pgsql-hackers

From didier
Subject Re: [proposal] Add an option for returning SQLSTATE in psql error message
Date
Msg-id CAJRYxu+X637Tdn+hkZe81dr0oaCxksw7z-ewn4uUL2ANOdr7Rw@mail.gmail.com
Whole thread Raw
In response to Re: [proposal] Add an option for returning SQLSTATE in psql error message  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Responses Re: [proposal] Add an option for returning SQLSTATE in psql error message  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Yep, name is bad, but I'm not sure about VERBOSITY, isn't it
controlling output from the server not the client?
You may want to set both VERBOSITY to 'verbose' and ECHO_ERROR to
'none' then in script do
SELECT .... -- no error output
\if :ERROR
   -- do something with LAST_ERROR_MESSAGE



On Mon, Dec 3, 2018 at 4:49 PM Andrew Gierth
<andrew@tao11.riddles.org.uk> wrote:
>
> >>>>> "didier" == didier  <did447@gmail.com> writes:
>
>  didier> Attached a POC adding a new variable ECHO_ERROR
>  didier> \set ECHO_ERROR text|none|psqlstate
>
> I wouldn't have called it that. Possibly another option to the existing
> VERBOSITY variable? \set VERBOSITY sqlstate_only or something of that
> ilk (it's already not unusual to use \set VERBOSITY terse in regression
> tests)
>
> --
> Andrew (irc:RhodiumToad)


pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: [proposal] Add an option for returning SQLSTATE in psql error message
Next
From: Liudmila Mantrova
Date:
Subject: Re: SQL/JSON: documentation