Re: [proposal] Add an option for returning SQLSTATE in psql error message
didier <did447@gmail.com>
From: didier <did447@gmail.com>
To: andrew@tao11.riddles.org.uk
Cc: Tom Lane <tgl@sss.pgh.pa.us>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2018-12-03T16:21:38Z
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@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)
Commits
-
Add a "SQLSTATE-only" error verbosity option to libpq and psql.
- 7bac3acab4d5 12.0 landed