pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pg_dump: Fix dumping of inherited generated columns
Date: Wed, 03 Feb 2021 11:54:35 +0000
Message-ID: <E1l7Gjz-0005Cx-2O@gemulon.postgresql.org> (raw)

pg_dump: Fix dumping of inherited generated columns

Generation expressions of generated columns are always inherited, so
there is no need to set them separately in child tables, and there is
no syntax to do so either.  The code previously used the code paths
for the handling of default values, for which different rules apply;
in particular it might want to set a default value explicitly for an
inherited column.  This resulted in unrestorable dumps.  For generated
columns, just skip them in inherited tables.

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/15830.1575468847%40sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0bf83648a52df96f7c8677edbbdf141bfa0cf32b

Modified Files
--------------
src/bin/pg_dump/common.c         | 31 +++++++++++++++++++++------
src/bin/pg_dump/pg_dump.c        | 37 +++++++++++++++++++++++++++-----
src/bin/pg_dump/t/002_pg_dump.pl | 46 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 102 insertions(+), 12 deletions(-)



view thread (3+ messages)  latest in thread

Message-ID: <E1l7Gjz-0005Cx-2O@gemulon.postgresql.org>
Permalink:  ../E1l7Gjz-0005Cx-2O@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1l7Gjz-0005Cx-2O@gemulon.postgresql.org

 · 

reply

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: peter@eisentraut.org
  Subject: Re: pgsql: pg_dump: Fix dumping of inherited generated columns
  In-Reply-To: <E1l7Gjz-0005Cx-2O@gemulon.postgresql.org>
  References: <E1l7Gjz-0005Cx-2O@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