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@lists.postgresql.org
Subject: pgsql: pg_dump: Fix ArchiveEntry handling of some empty values
Date: Thu, 28 Feb 2019 20:23:23 +0000
Message-ID: <E1gzSDD-0001OA-Jy@gemulon.postgresql.org> (raw)

pg_dump: Fix ArchiveEntry handling of some empty values

Commit f831d4acc changed what pg_dump emits for some empty fields: they
were output as empty strings before, NULL pointer afterwards.  That
makes old pg_restore unable to work (crash) with such files, which is
unacceptable.  Return to the original representation by explicitly
setting those struct members to "" where needed; remove some no longer
needed checks for NULL input.

We can declutter the code a little by returning to NULLs when we next
update the archive version, so add a note to remind us later.

Discussion: https://postgr.es/m/20190225074539.az6j3u464cvsoxh6@depesz.com
Reported-by: hubert depesz lubaczewski
Author: Dmitry Dolgov

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/19455c9f5606072a191962271c35ad659fbab526

Modified Files
--------------
src/bin/pg_dump/pg_backup_archiver.c | 11 ++++---
src/bin/pg_dump/pg_backup_archiver.h |  7 ++++-
src/bin/pg_dump/pg_dump.c            | 56 ++++++++++++++++++++++++++++++------
3 files changed, 58 insertions(+), 16 deletions(-)



Message-ID: <E1gzSDD-0001OA-Jy@gemulon.postgresql.org>
Permalink:  ../E1gzSDD-0001OA-Jy@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1gzSDD-0001OA-Jy@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: pg_dump: Fix ArchiveEntry handling of some empty values
  In-Reply-To: <E1gzSDD-0001OA-Jy@gemulon.postgresql.org>
  References: <E1gzSDD-0001OA-Jy@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