The following bug has been logged online:
Bug reference: 4203
Logged by: Henry Combrinck
Email address: henry@zen.co.za
PostgreSQL version: 8.2.6 and 8.3.1
Operating system: Linux
Description: perform dblink() in begin/exception returns wrong
SQLSTATE code
Details:
Apologies if this is the wrong forum to report this (perhaps it needs to go
to the dblink() maintainer?)
In a function on a machine using 8.2.6, the following returns a strange
SQLSTATE code:
begin
perform dblink ('host=other_machine ...',
'insert into table...');
exception when others then
raise notice 'SQLSTATE: %', SQLSTATE;
end;
The code returned is always 42601 (syntax_error) irrespective of the actual
error (eg, unique_violation).