]> git.ipfire.org Git - thirdparty/postgresql.git/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:48 +0000 (21:52 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 9 Oct 2012 01:52:48 +0000 (21:52 -0400)
commitbb3aa7a484a53d80784c367e2ff272b8730e338d
treee889e2bdf0b9a0c21202c1c1aae51376e87b69d9
parenta883c02449cf86a657838303213d11ad85939b1d
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