pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@postgresql.org
Subject: pgsql: Fix pg_dump's errno checking for zlib I/O
Date: Wed, 02 Aug 2017 22:28:48 +0000
Message-ID: <E1dd28G-00005O-U6@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Fix pg_dump's errno checking for zlib I/O

Some error reports were reporting strerror(errno), which for some error
conditions coming from zlib are wrong, resulting in confusing reports
such as
  pg_restore: [compress_io] could not read from input file: Success
which makes no sense.  To correctly extract the error message we need to
use gzerror(), so let's do that.

This isn't as comprehensive or as neat as I would like, but at least it
should improve things in many common cases.  The zlib abstraction in
compress_io does not seem to be applied consistently enough; we could
perhaps improve that, but it seems master-only material, not a bug fix
for back-patching.

This problem goes back all the way, but I decided to apply back to 9.4
only, because older branches don't contain commit 14ea89366 which this
change depends on.

Authors: Vladimir Kunschikov, Álvaro Herrera
Discussion: https://postgr.es/m/1498120508308.9826@infotecs.ru

Branch
------
REL9_4_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/330e68734b822416b5ef94da64f9b6b92f46c083

Modified Files
--------------
src/bin/pg_dump/compress_io.c         | 24 +++++++++++++++++++++++-
src/bin/pg_dump/compress_io.h         |  1 +
src/bin/pg_dump/pg_backup_directory.c | 10 +++++++---
src/bin/pg_dump/pg_backup_tar.c       |  8 +++++++-
4 files changed, 38 insertions(+), 5 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


view thread (6+ messages)  latest in thread

Message-ID: <E1dd28G-00005O-U6@gemulon.postgresql.org>
Permalink:  ../E1dd28G-00005O-U6@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1dd28G-00005O-U6@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: alvherre@alvh.no-ip.org
  Subject: Re: pgsql: Fix pg_dump's errno checking for zlib I/O
  In-Reply-To: <E1dd28G-00005O-U6@gemulon.postgresql.org>
  References: <E1dd28G-00005O-U6@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