]> granicus.if.org Git - postgresql/commit
Make dblink try harder to form useful error messages
authorJoe Conway <mail@joeconway.com>
Thu, 22 Dec 2016 17:46:46 +0000 (09:46 -0800)
committerJoe Conway <mail@joeconway.com>
Thu, 22 Dec 2016 17:46:46 +0000 (09:46 -0800)
commit44de099f89c2a2d94c78f80f09555fd9b5792583
tree1648c36caa6635bdb39a385a9711b27a5c9f3d0a
parent501c9107487d33e234f4af8bf77f2aa64c05e6d3
Make dblink try harder to form useful error messages

When libpq encounters a connection-level error, e.g. runs out of memory
while forming a result, there will be no error associated with PGresult,
but a message will be placed into PGconn's error buffer. postgres_fdw
takes care to use the PGconn error message when PGresult does not have
one, but dblink has been negligent in that regard. Modify dblink to mirror
what postgres_fdw has been doing.

Back-patch to all supported branches.

Author: Joe Conway
Reviewed-By: Tom Lane
Discussion: https://postgr.es/m/02fa2d90-2efd-00bc-fefc-c23c00eb671e%40joeconway.com
contrib/dblink/dblink.c