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

Re: BUG #4203: perform dblink() in begin/exception returns wrong SQLSTATE code

From: Joe Conway <mail(at)joeconway(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Henry Combrinck <henry(at)zen(dot)co(dot)za>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4203: perform dblink() in begin/exception returns wrong SQLSTATE code
Date: 2008-05-27 19:39:37
Message-ID: 483C6379.8020001@joeconway.com (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-patches
Tom Lane wrote:
> "Henry Combrinck" <henry(at)zen(dot)co(dot)za> writes:
>> Description:        perform dblink() in begin/exception returns wrong
>> SQLSTATE code
> 
>> The code returned is always 42601 (syntax_error) irrespective of the actual
>> error (eg, unique_violation).
> 
> Yeah, the dblink code should probably try a bit harder to propagate the
> original error fields.  I'm inclined to think that it should propagate
> sqlstate/message/detail/hint verbatim, and indicate the fact that this
> happened on a dblink connection as CONTEXT, rather than structuring the
> ereport the way it does now.  Joe, what do you think?

Sounds reasonable. Do you think this is a bug fix or an 8.4 enhancement? 
I will try to take a closer look at the specific fix this weekend.

Joe


In response to

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2008-05-27 20:24:05
Subject: Re: BUG #4203: perform dblink() in begin/exception returns wrong SQLSTATE code
Previous:From: Tomasz RybakDate: 2008-05-27 19:14:23
Subject: BUG #4204: COPY to table with FK has memory leak

pgsql-patches by date

Next:From: Tom LaneDate: 2008-05-27 20:24:05
Subject: Re: BUG #4203: perform dblink() in begin/exception returns wrong SQLSTATE code
Previous:From: Simon RiggsDate: 2008-05-27 19:35:51
Subject: Hint Bits and Write I/O

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