Re: A few questions about foreign tables - Mailing list pgsql-general

From Marcin Borkowski
Subject Re: A few questions about foreign tables
Date
Msg-id 871qdp3dij.fsf@mbork.pl
Whole thread Raw
In response to Re: A few questions about foreign tables  (Ron <ronljohnsonjr@gmail.com>)
List 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 by date:

Previous
From: Marcin Borkowski
Date:
Subject: Re: A few questions about foreign tables
Next
From: Marcin Borkowski
Date:
Subject: Is postgres_fdw "safe"?