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

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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Henry Combrinck" <henry(at)zen(dot)co(dot)za>
Cc: pgsql-bugs(at)postgresql(dot)org, Joe Conway <mail(at)joeconway(dot)com>
Subject: Re: BUG #4203: perform dblink() in begin/exception returns wrong SQLSTATE code
Date: 2008-05-27 15:56:43
Message-ID: 28639.1211903803@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-patches
"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?

			regards, tom lane

In response to

Responses

pgsql-bugs by date

Next:From: Tomasz RybakDate: 2008-05-27 19:14:23
Subject: BUG #4204: COPY to table with FK has memory leak
Previous:From: Henry CombrinckDate: 2008-05-27 15:13:26
Subject: BUG #4203: perform dblink() in begin/exception returns wrong SQLSTATE code

pgsql-patches by date

Next:From: Tom LaneDate: 2008-05-27 16:08:07
Subject: Re: Doc patch: type modifiers
Previous:From: Jeff DavisDate: 2008-05-27 15:22:22
Subject: Doc patch: type modifiers

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