]> granicus.if.org Git - postgresql/commit
Allow for pg_upgrade of attributes with missing values
authorAndrew Dunstan <andrew@dunslane.net>
Fri, 22 Jun 2018 12:42:36 +0000 (08:42 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Fri, 22 Jun 2018 12:42:36 +0000 (08:42 -0400)
commit2448adf29c543befbac59f1ecfbb3ef4b0d808ce
tree909781bb5c224aed66d84c6152b8ce93140b5fb6
parent9a994e37e08df3578f52011543dc28085dc18e21
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
src/backend/catalog/heap.c
src/backend/utils/adt/pg_upgrade_support.c
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.h
src/include/catalog/catversion.h
src/include/catalog/heap.h
src/include/catalog/pg_proc.dat
src/test/regress/expected/fast_default.out
src/test/regress/sql/fast_default.sql