Viewing new 9.3 error fields

Started by Bruce Momjianalmost 13 years ago4 messages
#1Bruce Momjian
bruce@momjian.us

This blog entry displays the new 9.3 error fields, schema/table/constraint:

http://www.depesz.com/2013/03/07/waiting-for-9-3-provide-database-object-names-as-separate-fields-in-error-messages/

$ INSERT INTO t (i) VALUES (1);
psql:z.sql:16: ERROR: 23505: duplicate key value violates unique constraint "t2_pkey"
DETAIL: Key (i)=(1) already exists.
CONTEXT: SQL statement "INSERT INTO t2 (i) VALUES (NEW.i)"
PL/pgSQL function copy_value() line 4 at SQL statement
--> SCHEMA NAME: public
--> TABLE NAME: t2
--> CONSTRAINT NAME: t2_pkey
LOCATION: _bt_check_unique, nbtinsert.c:398

However, I am unable to see this in psql:

CREATE TABLE ledger (id SERIAL, balance NUMERIC(10,2) unique);

SET log_error_verbosity = 'verbose';

INSERT INTO ledger VALUES (DEFAULT, 1);

INSERT INTO ledger VALUES (DEFAULT, 1);
ERROR: duplicate key value violates unique constraint "ledger_balance_key"
DETAIL: Key (balance)=(1.00) already exists.
-->

What am I missing?

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

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

#2Dickson S. Guedes
listas@guedesoft.net
In reply to: Bruce Momjian (#1)
Re: Viewing new 9.3 error fields

Em Qui, 2013-04-11 às 14:08 -0400, Bruce Momjian escreveu:

This blog entry displays the new 9.3 error fields, schema/table/constraint:

http://www.depesz.com/2013/03/07/waiting-for-9-3-provide-database-object-names-as-separate-fields-in-error-messages/

$ INSERT INTO t (i) VALUES (1);
psql:z.sql:16: ERROR: 23505: duplicate key value violates unique constraint "t2_pkey"
DETAIL: Key (i)=(1) already exists.
CONTEXT: SQL statement "INSERT INTO t2 (i) VALUES (NEW.i)"
PL/pgSQL function copy_value() line 4 at SQL statement
--> SCHEMA NAME: public
--> TABLE NAME: t2
--> CONSTRAINT NAME: t2_pkey
LOCATION: _bt_check_unique, nbtinsert.c:398

However, I am unable to see this in psql:

CREATE TABLE ledger (id SERIAL, balance NUMERIC(10,2) unique);

SET log_error_verbosity = 'verbose';

INSERT INTO ledger VALUES (DEFAULT, 1);

INSERT INTO ledger VALUES (DEFAULT, 1);
ERROR: duplicate key value violates unique constraint "ledger_balance_key"
DETAIL: Key (balance)=(1.00) already exists.
-->

What am I missing?

Isn't it on log output?

--
Dickson S. Guedes
mail/xmpp: guedes@guedesoft.net - skype: guediz
http://guedesoft.net - http://www.postgresql.org.br
http://www.rnp.br/keyserver/pks/lookup?search=0x8F3E3C06D428D10A

#3Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Bruce Momjian (#1)
Re: Viewing new 9.3 error fields

Bruce Momjian wrote:

However, I am unable to see this in psql:

CREATE TABLE ledger (id SERIAL, balance NUMERIC(10,2) unique);

SET log_error_verbosity = 'verbose';

INSERT INTO ledger VALUES (DEFAULT, 1);

INSERT INTO ledger VALUES (DEFAULT, 1);
ERROR: duplicate key value violates unique constraint "ledger_balance_key"
DETAIL: Key (balance)=(1.00) already exists.
-->

What am I missing?

\set VERBOSITY verbose

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

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

#4Bruce Momjian
bruce@momjian.us
In reply to: Alvaro Herrera (#3)
Re: Viewing new 9.3 error fields

On Thu, Apr 11, 2013 at 03:31:17PM -0300, Alvaro Herrera wrote:

Bruce Momjian wrote:

However, I am unable to see this in psql:

CREATE TABLE ledger (id SERIAL, balance NUMERIC(10,2) unique);

SET log_error_verbosity = 'verbose';

INSERT INTO ledger VALUES (DEFAULT, 1);

INSERT INTO ledger VALUES (DEFAULT, 1);
ERROR: duplicate key value violates unique constraint "ledger_balance_key"
DETAIL: Key (balance)=(1.00) already exists.
-->

What am I missing?

\set VERBOSITY verbose

Thanks, that worked. :-)

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

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