pgsql: Fix lo_import and lo_export to return useful error messages more - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Fix lo_import and lo_export to return useful error messages more
Date
Msg-id E1TLP0k-0000iP-An@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/bc433317ae2b0494dea4526b89dc7bb90a65d79b

Modified Files
--------------
src/interfaces/libpq/fe-lobj.c |   45 ++++++++++++++++++++++++++-------------
1 files changed, 30 insertions(+), 15 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Fix lo_import and lo_export to return useful error messages more
Next
From: Tom Lane
Date:
Subject: pgsql: Fix lo_import and lo_export to return useful error messages more