aboutsummaryrefslogtreecommitdiff
path: root/src/bin/pg_dump/pg_backup_archiver.h
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2019-02-28 17:16:08 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2019-02-28 17:19:44 -0300
commit19455c9f5606072a191962271c35ad659fbab526 (patch)
tree630ad889675790e1c5db63e2da3f7d7fcab794ae /src/bin/pg_dump/pg_backup_archiver.h
parent3f61999cc9da68890174dd8cf97f2cb96b223e81 (diff)
downloadpostgresql-19455c9f5606072a191962271c35ad659fbab526.tar.gz
postgresql-19455c9f5606072a191962271c35ad659fbab526.zip
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
Diffstat (limited to 'src/bin/pg_dump/pg_backup_archiver.h')
-rw-r--r--src/bin/pg_dump/pg_backup_archiver.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/bin/pg_dump/pg_backup_archiver.h b/src/bin/pg_dump/pg_backup_archiver.h
index 4d8f499247c..ebf3d209ea1 100644
--- a/src/bin/pg_dump/pg_backup_archiver.h
+++ b/src/bin/pg_dump/pg_backup_archiver.h
@@ -95,7 +95,12 @@ typedef z_stream *z_streamp;
#define K_VERS_1_13 MAKE_ARCHIVE_VERSION(1, 13, 0) /* change search_path
* behavior */
-/* Current archive version number (the format we can output) */
+/*
+ * Current archive version number (the format we can output)
+ *
+ * Note: If you update the current archive version, consider
+ * https://postgr.es/m/20190227123217.GA27552@alvherre.pgsql
+ */
#define K_VERS_MAJOR 1
#define K_VERS_MINOR 13
#define K_VERS_REV 0