]> 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:52:42 +0000 (21:52 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 9 Oct 2012 01:52:42 +0000 (21:52 -0400)
commitc5b8daa08d9abf7812d58617b834a6589760f8af
treef13c7c74ba3d1c9f8c65e3d21d3455e9f61a9f20
parentcf9d99298cf8b59f8cd0f73f5e74e45c2462eb7e
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