From: Andrew Dunstan <andrew@dunslane.net>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Allow for pg_upgrade of attributes with missing values
Date: Fri, 22 Jun 2018 12:58:47 +0000
Message-ID: <E1fWLeJ-0006wh-4F@gemulon.postgresql.org> (raw)
Allow for pg_upgrade of attributes with missing values
Commit 16828d5c02 neglected to do this, so upgraded databases would
silently get null instead of the specified default in rows without the
attribute defined.
A new binary upgrade function is provided to perform this and pg_dump is
adjusted to output a call to the function if required in binary upgrade
mode.
Also included is code to drop missing attribute values for dropped
columns. That way if the type is later dropped the missing value won't
have a dangling reference to the type.
Finally the regression tests are adjusted to ensure that there is a row
with a missing value so that this code is exercised in upgrade testing.
Catalog version unfortunately bumped.
Regression test changes from Tom Lane.
Remainder from me, reviewed by Tom Lane, Andres Freund, Alvaro Herrera
Discussion: https://postgr.es/m/19987.1529420110@sss.pgh.pa.us
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/2448adf29c543befbac59f1ecfbb3ef4b0d808ce
Modified Files
--------------
src/backend/catalog/heap.c | 80 ++++++++++++++++++++++++++++++
src/backend/utils/adt/pg_upgrade_support.c | 16 ++++++
src/bin/pg_dump/pg_dump.c | 71 +++++++++++++++++++++++---
src/bin/pg_dump/pg_dump.h | 1 +
src/include/catalog/catversion.h | 2 +-
src/include/catalog/heap.h | 1 +
src/include/catalog/pg_proc.dat | 4 ++
src/test/regress/expected/fast_default.out | 11 ++++
src/test/regress/sql/fast_default.sql | 7 +++
9 files changed, 186 insertions(+), 7 deletions(-)
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: andrew@dunslane.net
Subject: Re: pgsql: Allow for pg_upgrade of attributes with missing values
In-Reply-To: <E1fWLeJ-0006wh-4F@gemulon.postgresql.org>
References: <E1fWLeJ-0006wh-4F@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