Getting rid of "unknown error" in dblink and postgres_fdw

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Getting rid of "unknown error" in dblink and postgres_fdw
Date: 2016-12-21 16:49:25
Message-ID: 19872.1482338965@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

We have a report in pgsql-general of a dblink query failing with
ERROR: unknown error
This is, to say the least, unhelpful. And it violates our error
message style guidelines.

Where that is coming from is a situation where we've failed to extract
any primary message from a remote error. (I theorize that today's report
is triggered by an out-of-memory situation, but that's only an unsupported
guess at the moment.)

I propose that we should change that string to "could not obtain message
string for error on connection "foo"", or something along that line.

postgres_fdw has the same disease. It wouldn't have the notion of a named
connection, but maybe we could insert the foreign server name instead.

A possible objection is that if we really are on the hairy edge of OOM,
trying to construct such error strings might push us over the edge and
then you get "out of memory" instead. But IMO that's not worse; it
could be argued to be a more useful description of the problem.

Comments?

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-12-21 16:50:24 Re: Declarative partitioning - another take
Previous Message Robert Haas 2016-12-21 16:30:44 Re: [PATCH] Transaction traceability - txid_status(bigint)