CREATE TABLE parent1 (
col text
);
CREATE TABLE parent2 (
col text
);
CREATE TABLE child () INHERITS (parent1, parent2);
ALTER TABLE ONLY parent1 ALTER COLUMN col SET STORAGE EXTERNAL;
ALTER TABLE ONLY parent2 ALTER COLUMN col SET STORAGE MAIN;
pg_dump dumps those commands in different order (dump attached), with
the SET STORAGE commands before creating the child table. But that's not
allowed:
psql:mixed-storage-inheritance.sql:53: ERROR: inherited column "col"
has a storage parameter conflict
DETAIL: EXTERNAL versus MAIN
That's not good.
What's the best way to fix it? Perhaps pg_dump should leave out the
INHERITS clause from the CREATE TABLE statement, and dump separate
"ALTER TABLE child INHERIT" commands to make it inherited? But then
'attislocal' is wrongly to false for the columns. Or perhaps relax the
check for mixed storage options, so that the CREATE TABLE won't throw
that error.
- Heikki