Re: [proposal] Add an option for returning SQLSTATE in psql error message

From: didier <did447(at)gmail(dot)com>
To: andrew(at)tao11(dot)riddles(dot)org(dot)uk
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [proposal] Add an option for returning SQLSTATE in psql error message
Date: 2018-12-03 16:21:38
Message-ID: CAJRYxu+X637Tdn+hkZe81dr0oaCxksw7z-ewn4uUL2ANOdr7Rw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)tao11(dot)riddles(dot)org(dot)uk> wrote:
>
> >>>>> "didier" == didier <did447(at)gmail(dot)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)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Liudmila Mantrova 2018-12-03 16:23:09 Re: SQL/JSON: documentation
Previous Message Pavel Stehule 2018-12-03 16:12:26 Re: [proposal] Add an option for returning SQLSTATE in psql error message