Re: Add schema-qualified relnames in constraint error messages. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Add schema-qualified relnames in constraint error messages.
Date
Msg-id 5140.1452050218@sss.pgh.pa.us
Whole thread Raw
In response to Re: Add schema-qualified relnames in constraint error messages.  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Responses Re: Add schema-qualified relnames in constraint error messages.  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Re: Add schema-qualified relnames in constraint error messages.  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Jim Nasby <Jim.Nasby@bluetreble.com> writes:
> FWIW, I suspect very few people know about the verbosity setting (I 
> didn't until a few months ago...) Maybe psql should hint about it the 
> first time an error is reported in a session.

Actually, what'd be really handy IMO is something to regurgitate the
most recent error in verbose mode, without making a permanent session
state change.  Something like

regression=# insert into bar values(1);
ERROR:  insert or update on table "bar" violates foreign key constraint "bar_f1_fkey"
DETAIL:  Key (f1)=(1) is not present in table "foo".
regression=# \saywhat
ERROR:  23503: insert or update on table "bar" violates foreign key constraint "bar_f1_fkey"
DETAIL:  Key (f1)=(1) is not present in table "foo".
SCHEMA NAME:  public
TABLE NAME:  bar
CONSTRAINT NAME:  bar_f1_fkey
LOCATION:  ri_ReportViolation, ri_triggers.c:3326
regression=# 

Not sure how hard that would be to do within psql's current structure.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: [PATCH] Refactoring of LWLock tranches
Next
From: Jim Nasby
Date:
Subject: Re: Add schema-qualified relnames in constraint error messages.