pgsql: Allow for pg_upgrade of attributes with missing values

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема pgsql: Allow for pg_upgrade of attributes with missing values
Дата
Msg-id E1fWLeJ-0006wh-4F@gemulon.postgresql.org
обсуждение исходный текст
Ответы Re: pgsql: Allow for pg_upgrade of attributes with missing values  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-committers
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(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Alexander Korotkov
Дата:
Сообщение: pgsql: Fixes for vacuum_cleanup_index_scale_factor GUC option
Следующее
От: Robert Haas
Дата:
Сообщение: pgsql: Avoid generating bogus paths with partitionwise aggregate.