postgres_fdw: IMPORT FOREIGN SCHEMA ... LIMIT TO (partition)

Поиск
Список
Период
Сортировка
От Matthias van de Meent
Тема postgres_fdw: IMPORT FOREIGN SCHEMA ... LIMIT TO (partition)
Дата
Msg-id CAEze2Whwg4i=mzApMe+PXxCEfgoZmHGqdqQFW7J4bmj_5p6t1A@mail.gmail.com
обсуждение исходный текст
Ответы Re: postgres_fdw: IMPORT FOREIGN SCHEMA ... LIMIT TO (partition)  (Bernd Helmle <mailings@oopsware.de>)
Список pgsql-hackers
Hi,

Recently I was trying to copy some of the data of one database to
another through postgres_fdw, and found that it wouldn't import that
partition through IMPORT FOREIGN SCHEMA, even when I explicitly
specified the name of the table that contained the data in the LIMIT
TO clause.

I realised the reason is that currently, postgres_fdw explicitly
disallows importing foreign partitions. This is a reasonable default
when importing a whole schema, but if I wanted to explicitly import
one of a partitioned tables' partitions, that would now require me to
manually copy the foreign table's definitions through the use of
CREATE FOREIGN TABLE, which is a hassle and prone to mistakes.

As such, I propose the attached patch, in which the 'no
partitions'-restriction of postgres_fdw is lifted for the LIMIT TO
clause. This has several benefits, including not holding locks on the
foreign root partition during queries, and less suprising behaviour
for LIMIT TO ("table that happens to be a partition").

Regards,

Matthias van de Meent

Вложения

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

Предыдущее
От: Amul Sul
Дата:
Сообщение: Re: [Patch] ALTER SYSTEM READ ONLY
Следующее
От: Denis Laxalde
Дата:
Сообщение: [PATCH] Disable bgworkers during servers start in pg_upgrade