]> git.ipfire.org Git - thirdparty/postgresql.git/commit
pg_dump: Fix dumping of inherited generated columns
authorPeter Eisentraut <peter@eisentraut.org>
Wed, 3 Feb 2021 10:27:13 +0000 (11:27 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Wed, 3 Feb 2021 10:58:15 +0000 (11:58 +0100)
commit1dd6baf7880240102aff76a1a28098228915de14
treeffc0f62c615c0a4d12c7a4fdf077a6540820727b
parent78fab843386bbaaaa4f74b26859d669e89d7db63
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
src/bin/pg_dump/common.c
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/t/002_pg_dump.pl