Skip site navigation (1) Skip section navigation (2)

Re: enhanced error fields

From: Peter Geoghegan <peter(at)2ndquadrant(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "anarazel(at)anarazel(dot)de" <andres(at)anarazel(dot)de>, Robert Haas <robertmhaas(at)gmail(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Subject: Re: enhanced error fields
Date: 2013-01-06 20:39:24
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On 5 January 2013 18:06, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
> I have no more new arguments for these fields - yes, there are no change

Attached revision is similar to the eelog4.diff patch (i.e. it has
only a few fields, most of which are present within the original error
message). Note that "schema_name" remains, because it was so easy to
keep it around since we pass the new infrastructure a Relation (which
also serves to sanitize). There are a few differences:

* All logging infrastructure has been removed. If the sole purpose of
this patch is to facilitate client code, it doesn't make sense to
redundantly log what is indicated by an error message. My feelings on
log-scraping tools are well known (that they shouldn't need to exist,
even if they currently do), so it won't surprise anyone to learn that
I think it's totally wrong-headed to actively facilitate them.

* Miscellaneous minor tweaks.

I think it's probably fine that we don't go into detail about how
ERRCODE_NOT_NULL_VIOLATION errors won't have a schema_name and
table_name for domains - it's obvious that they don't, because a name
cannot exist in principle. This is documented here, for example:

  				if (isnull)
+ 					/*
+ 					 * We don't provide errtable here, because it is
+ 					 * unavailable, though we require it anywhere where it is
+ 					 * available in principle.
+ 					 */
  							 errmsg("domain %s does not allow null values",

We also go to extra lengths to get a table_name for certain
domain-related ereport sites.

So, with the question of what fields to include and whether constraint
name needs to be unambiguously resolvable addressed (I think), it
appears that I've brought this one as far as I can. I'd still like to
get input from a Perl hacker, but I think a committer needs to pick
this up now.

Peter Geoghegan
PostgreSQL Development, 24x7 Support, Training and Services

Attachment: eelog6.patch
Description: application/octet-stream (39.6 KB)

In response to


pgsql-hackers by date

Next:From: Simon RiggsDate: 2013-01-06 21:29:07
Subject: Re: Re: [COMMITTERS] pgsql: Invent a "one-shot" variant of CachedPlans for better performanc
Previous:From: Simon RiggsDate: 2013-01-06 19:47:48
Subject: Re: [PERFORM] Slow query: bitmap scan troubles

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group