Dumping/restoring fails on inherited generated column
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-hackers@lists.postgresql.org
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Date: 2019-12-04T14:14:07Z
Lists: pgsql-hackers
Run the regression tests with "make installcheck", then: $ pg_dump -Fc regression >r.dump $ createdb r2 $ pg_restore -d r2 r.dump pg_restore: while PROCESSING TOC: pg_restore: from TOC entry 6005; 2604 24821 DEFAULT gtest1_1 b postgres pg_restore: error: could not execute query: ERROR: column "b" of relation "gtest1_1" is a generated column Command was: ALTER TABLE ONLY public.gtest1_1 ALTER COLUMN b SET DEFAULT (a * 2); pg_restore: warning: errors ignored on restore: 1 $ It looks like gtest1_1 inherits column "b" from gtest1, so possibly pg_dump is just confused about the combination of inheritance and generated columns. I see this in v12 as well as HEAD. One interesting question is how come the pg_upgrade test isn't failing --- maybe binary-upgrade mode handles this case differently? regards, tom lane
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