pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: In pg_restore's dump_lo_buf(), work a little harder on error han
Date: Sun, 18 Oct 2020 16:26:09 +0000
Message-ID: <E1kUBVZ-000209-RY@gemulon.postgresql.org> (raw)

In pg_restore's dump_lo_buf(), work a little harder on error handling.

Failure to write data to a large object during restore led to an ugly
and uninformative error message.  To add insult to injury, it then
fatal'd out, where other SQL-level errors usually result in pressing on.

Report the underlying error condition, rather than just giving not-very-
useful byte counts, and use warn_or_exit_horribly() so as to adhere to
pg_restore's general policy about whether to continue or not.

Also recognize that lo_write() returns int not size_t.

Per report from Justin Pryzby, though I didn't use his patch.
Given the lack of comparable complaints, I'm not sure this is
worth back-patching.

Discussion: https://postgr.es/m/20201018010232.GF9241@telsasoft.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/929c69aa1970b3ae30bbb5a159b9dc530ec34d5c

Modified Files
--------------
src/bin/pg_dump/pg_backup_archiver.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)



Message-ID: <E1kUBVZ-000209-RY@gemulon.postgresql.org>
Permalink:  ../E1kUBVZ-000209-RY@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1kUBVZ-000209-RY@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: In pg_restore's dump_lo_buf(), work a little harder on error han
  In-Reply-To: <E1kUBVZ-000209-RY@gemulon.postgresql.org>
  References: <E1kUBVZ-000209-RY@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox