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: Masahiko Sawada <sawada.mshk@gmail.com>,
Masahiko Sawada <masahiko.sawada@2ndquadrant.com>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-02-03T19:18:33Z
Lists: pgsql-hackers
Attachments
- 0001-WIP-Fix-ALTER-TABLE-INHERIT-with-generated-columns.patch (text/plain) patch 0001
On 2021-01-29 17:41, Tom Lane wrote: > Also, in the example from [2], > > d3=# create table pp1 (a int, b int GENERATED ALWAYS AS (a * 2) STORED); > CREATE TABLE > d3=# create table cc1 (a int, b int GENERATED ALWAYS AS (a * 3) STORED); > CREATE TABLE > d3=# alter table cc1 inherit pp1; > ALTER TABLE > > pg_dump now omits to dump cc1's generation expression, which seems > strictly worse than before. Admittedly, the backend likely ought to > be rejecting this scenario, but it doesn't do so today. > > [2]https://www.postgresql.org/message-id/661371.1601398006%40sss.pgh.pa.us Here is a WIP patch to address this. Probably needs another look for column number mapping and all the usual stuff, but the basic idea should be okay. -- 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