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