pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Allow for pg_upgrade of attributes with missing values
3+ messages / 3 participants
[nested] [flat]

* pgsql: Allow for pg_upgrade of attributes with missing values
@ 2018-06-22 12:58 Andrew Dunstan <andrew@dunslane.net>
  2018-06-23 03:03 ` Re: pgsql: Allow for pg_upgrade of attributes with missing values Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: Andrew Dunstan @ 2018-06-22 12:58 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pgsql: Allow for pg_upgrade of attributes with missing values
  2018-06-22 12:58 pgsql: Allow for pg_upgrade of attributes with missing values Andrew Dunstan <andrew@dunslane.net>
@ 2018-06-23 03:03 ` Tom Lane <tgl@sss.pgh.pa.us>
  2018-06-23 04:02   ` Re: pgsql: Allow for pg_upgrade of attributes with missing values Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2018-06-23 03:03 UTC (permalink / raw)
  To: Andrew Dunstan <andrew@dunslane.net>; +Cc: pgsql-committers@lists.postgresql.org

Andrew Dunstan <andrew@dunslane.net> writes:
> Allow for pg_upgrade of attributes with missing values

Buildfarm results suggest that binary_upgrade_set_missing_value should
have been marked proparallel => 'u'.

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pgsql: Allow for pg_upgrade of attributes with missing values
  2018-06-22 12:58 pgsql: Allow for pg_upgrade of attributes with missing values Andrew Dunstan <andrew@dunslane.net>
  2018-06-23 03:03 ` Re: pgsql: Allow for pg_upgrade of attributes with missing values Tom Lane <tgl@sss.pgh.pa.us>
@ 2018-06-23 04:02   ` Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Andrew Dunstan @ 2018-06-23 04:02 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers@lists.postgresql.org



On 06/22/2018 11:03 PM, Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
>> Allow for pg_upgrade of attributes with missing values
> Buildfarm results suggest that binary_upgrade_set_missing_value should
> have been marked proparallel => 'u'.


Argh! I'll fix it in the morning, along with adding "force_parallel = 
regress" to my testing regime. I guess I'll need to bump the cat version 
again?

cheers

andrew

-- 
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2018-06-23 04:02 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-06-22 12:58 pgsql: Allow for pg_upgrade of attributes with missing values Andrew Dunstan <andrew@dunslane.net>
2018-06-23 03:03 ` Tom Lane <tgl@sss.pgh.pa.us>
2018-06-23 04:02   ` Andrew Dunstan <andrew.dunstan@2ndquadrant.com>

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