pg_dump versus defaults on foreign tables

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pg_dump versus defaults on foreign tables
Дата
Msg-id 19884.1368650047@sss.pgh.pa.us
обсуждение исходный текст
Список pgsql-hackers
While fooling with the issue of serial columns for foreign tables,
I noticed that pg_dump will sometimes try to restore a default
expression with a command like this:

ALTER TABLE ONLY rem ALTER COLUMN f1 SET DEFAULT nextval('rem_f1_seq'::regclass);

which when applied to a foreign table gets you

ERROR:  "rem" is a foreign table
HINT:  Use ALTER FOREIGN TABLE instead.

Now, I suppose we could kluge up pg_dump to emit ALTER FOREIGN TABLE
instead, but I'd like to object to this degree of anal retentivity.
There is *no* good reason to refuse this command, and plenty of
precedent in favor of being laxer.  Most ALTER TABLE variants have
historically allowed any relation type for which the action is sensible.
As an example, three lines earlier in this same dump file I find

ALTER TABLE public.rem_f1_seq OWNER TO postgres;

for which we are not bleating that you have to use ALTER SEQUENCE
instead (and we'd better not start, since this usage is well embedded
in existing dump files).

Comments?
        regards, tom lane



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

Предыдущее
От: Claudio Freire
Дата:
Сообщение: Re: Parallel Sort
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: pg_dump versus defaults on foreign tables