From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | VIP: enhanced errors |
Date: | 2011-06-05 18:14:04 |
Message-ID: | BANLkTik0qNcvkBqXD9suw8j9U4wAT+V-fw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hello all
I am working on new diagnostics fields in errors - CONSTRAINT_NAME,
SCHEMA_NAME, TABLE_NAME and COLUMN_NAME.
These fields is shown when verbosity mode is active. Actually this
works for table constraints, not null constraint and for RI
constraints.
postgres=# delete from xxx;
ERROR: 23503: update or delete on table "xxx" violates foreign key
constraint "yyy_b_fkey" on table "yyy"
DETAIL: Key (a)=(10) is still referenced from table "yyy".
LOCATION: ri_ReportViolation, ri_triggers.c:3593
CONSTRAINT: yyy_b_fkey
SCHEMA: public
TABLE: xxx
COLUMN: a
These fields should be available from GET DIAGNOSTICS statement too -
It could be next step after support for stacked diagnostics.
I looked on column name identification for column constraints - and
there is not any possible identification - so I need a new column to
pg_constraint table - "attrid", that should to identify column for
column's constraint.
This patch is just concept. Final patch will be significantly longer -
we need to check any "ereport" call, as this most important
constraints are table and ri constraints.
Regards
Pavel Stehule
Attachment | Content-Type | Size |
---|---|---|
enhanced_error.diff | text/x-patch | 13.1 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2011-06-05 18:17:00 | Re: Assert failure when rechecking an exclusion constraint |
Previous Message | Kevin Grittner | 2011-06-05 17:45:41 | Re: SIREAD lock versus ACCESS EXCLUSIVE lock |