Multi-parent inherited table with mixed storage options cannot berestored

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Multi-parent inherited table with mixed storage options cannot berestored
Дата
Msg-id d6be600a-9590-24f6-e144-7f363aece0ab@iki.fi
обсуждение исходный текст
Ответы Re: Multi-parent inherited table with mixed storage options cannot be restored
Список pgsql-bugs
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


Вложения

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Konstantin Davydenka
Дата:
Сообщение: Re:BUG #16434: some data lost
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: BUG #16436: Functions with input parameter table type failingfrom application