Re: BUG #4203: perform dblink() in begin/exception returns wrong SQLSTATE code - Mailing list pgsql-bugs

From Joe Conway
Subject Re: BUG #4203: perform dblink() in begin/exception returns wrong SQLSTATE code
Date
Msg-id 483C6379.8020001@joeconway.com
Whole thread Raw
In response to Re: BUG #4203: perform dblink() in begin/exception returns wrong SQLSTATE code  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #4203: perform dblink() in begin/exception returns wrong SQLSTATE code
List pgsql-bugs
Tom Lane wrote:
> "Henry Combrinck" <henry@zen.co.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

pgsql-bugs by date:

Previous
From: "Tomasz Rybak"
Date:
Subject: BUG #4204: COPY to table with FK has memory leak
Next
From: Tom Lane
Date:
Subject: Re: BUG #4203: perform dblink() in begin/exception returns wrong SQLSTATE code