Re: Dumping/restoring fails on inherited generated column
Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Anastasia Lubennikova <a.lubennikova@postgrespro.ru>,
Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Masahiko Sawada <masahiko.sawada@2ndquadrant.com>,
Tom Lane <tgl@sss.pgh.pa.us>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-01-29T13:14:48Z
Lists: pgsql-hackers
Attachments
- v4-0001-pg_dump-Fix-dumping-of-inherited-generated-column.patch (text/plain) patch v4-0001
I've had another go at this, and I've found a solution that appears to address all the issues I'm aware of. It's all very similar to the previously discussed patches. The main difference is that previous patches had attempted to use something like tbinfo->attislocal to determine whether a column was inherited, but that's not correct. This patch uses the existing logic in flagInhAttrs() to find whether there is a matching parent column with a generation expression. I've added pg_dump test cases here to check the different variations that the code addresses. -- 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