Re: Dumping/restoring fails on inherited generated column
Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Anastasia Lubennikova <a.lubennikova@postgrespro.ru>,
Masahiko Sawada <sawada.mshk@gmail.com>,
Masahiko Sawada <masahiko.sawada@2ndquadrant.com>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-02-03T15:24:12Z
Lists: pgsql-hackers
On 2021-01-29 17:41, Tom Lane wrote: > However ... this doesn't solve all the cases noted in this thread. > In the first example I gave at [1], > > d3=# create table parent (f1 int default 2); > CREATE TABLE > d3=# create table child (f1 int default 3) inherits(parent); > NOTICE: merging column "f1" with inherited definition > CREATE TABLE > d3=# create table child2() inherits(parent); > CREATE TABLE > d3=# alter table child2 alter column f1 set default 42; > ALTER TABLE > > pg_dump still fails to restore child2.f1's non-inherited default. > That's probably a pre-existing problem, since it doesn't involve > GENERATED at all, but we shouldn't forget about it. > [1] https://www.postgresql.org/message-id/660925.1601397436%40sss.pgh.pa.us I can't tell what the problem is in this example. I tried with PG11, 12, and master, and the schema dump comes out with those same four commands and they restore correctly AFAICT. -- Peter Eisentraut 2ndQuadrant, an EDB company https://www.2ndquadrant.com/
Commits
-
Fix ALTER TABLE / INHERIT with generated columns
- 13ff139a2384 12.7 landed
- 64190d65f299 13.3 landed
- a970edbed306 14.0 landed
-
pg_dump: Fix dumping of inherited generated columns
- 1dd6baf78802 12.6 landed
- 1d3ce0223c6a 13.2 landed
- 0bf83648a52d 14.0 landed
-
Disallow ALTER TABLE ONLY / DROP EXPRESSION
- 539775981746 13.1 landed
- bf797a8d9768 14.0 landed
-
Fix several DDL issues of generated columns versus inheritance
- 086ffddf3656 13.0 cited