Fix lo_import and lo_export to return useful error messages more often.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: cd07b5a07f7c2322328c234824a1e11097145908
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2012-10-09T01:52:58Z
Releases: 8.4.15
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.

Files

PathChange+/−
src/interfaces/libpq/fe-lobj.c modified +24 −9