]> granicus.if.org Git - postgresql/commit
Fix lo_import and lo_export to return useful error messages more often.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 9 Oct 2012 01:53:04 +0000 (21:53 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 9 Oct 2012 01:53:04 +0000 (21:53 -0400)
commit36df743a4ab64704787b0bab2ee401cdf71ed839
tree8312440510a60f423b9603d894cfaf869427a233
parentd2fc89121915ac7b22906b16d3cbaaa397a4ad83
Fix lo_import and lo_export to return useful error messages more often.

I found that these functions tend to return -1 while leaving an empty error
message string in the PGconn, if they suffer some kind of I/O error on the
file.  The reason is that lo_close, which thinks it's executed a perfectly
fine SQL command, clears the errorMessage.  The minimum-change workaround
is to reorder operations here so that we don't fill the errorMessage until
after lo_close.
src/interfaces/libpq/fe-lobj.c