Skip site navigation (1) Skip section navigation (2)

pgsql: Fix lo_import and lo_export to return useful error messagesmore

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix lo_import and lo_export to return useful error messagesmore
Date: 2012-10-09 01:53:30
Message-ID: E1TLP0k-0000iZ-Bb@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: 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
------
REL8_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/36df743a4ab64704787b0bab2ee401cdf71ed839

Modified Files
--------------
src/interfaces/libpq/fe-lobj.c |   33 ++++++++++++++++++++++++---------
1 files changed, 24 insertions(+), 9 deletions(-)

pgsql-committers by date

Next:From: Alvaro HerreraDate: 2012-10-09 04:13:14
Subject: Re: pgsql: Fix thinko in previous commit
Previous:From: Tom LaneDate: 2012-10-09 01:20:14
Subject: pgsql: Fix lo_read, lo_write,lo_truncate to cope with "size_t" length

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group