Getting rid of "unknown error" in dblink and postgres_fdw
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-hackers@postgreSQL.org
Date: 2016-12-21T16:49:25Z
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
Commits
-
Make dblink try harder to form useful error messages
- 2f802d95b490 10.0 landed
- 51126ccdb1ce 9.6.2 landed
- 80ca22aa60a6 9.5.6 landed
- 76943f54a743 9.4.11 landed
- 9b8507bfae91 9.3.16 landed
- 44de099f89c2 9.2.20 landed
-
Improve dblink error message when remote does not provide it
- 88673c9d3bc7 9.6.2 landed
- 28c9b6be7f76 9.5.6 landed
- 0f5b1867c2e6 9.4.11 landed
- 3272be346895 9.3.16 landed
- fb0ab06dc4f4 9.2.20 landed
- ea0aa9698cfa 10.0 landed