Re: A few questions about foreign tables

Поиск
Список
Период
Сортировка
От Marcin Borkowski
Тема Re: A few questions about foreign tables
Дата
Msg-id 871qdp3dij.fsf@mbork.pl
обсуждение исходный текст
Ответ на Re: A few questions about foreign tables  (Ron <ronljohnsonjr@gmail.com>)
Список pgsql-general
On 2023-10-18, at 18:14, Ron <ronljohnsonjr@gmail.com> wrote:

> And SELECT relnamespace::regnamespace::text, relname FROM pg_class
> WHERE relkind='f'; tells you all of the foreign tables.
>
> Thus, this (untested) query generate all of the DROP FOREIGN TABLE statements:
> SELECT format('DROP FOREIGN TABLE IF EXISTS %I.%I RESTRICT;'
>  , relnamespace::regnamespace::text, relname)
> FROM pg_class WHERE relkind='f'
> ORDER BY relkind;

Thanks, though happily I only have about a dozen of them, so I could
create these by hand (well, actually by some automation features of my
text editor).

Best,

-- 
Marcin Borkowski
http://mbork.pl



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

Предыдущее
От: Marcin Borkowski
Дата:
Сообщение: Re: A few questions about foreign tables
Следующее
От: Marcin Borkowski
Дата:
Сообщение: Is postgres_fdw "safe"?