Re: A few questions about foreign tables

From: Marcin Borkowski <mbork(at)mbork(dot)pl>
To: Ron <ronljohnsonjr(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: A few questions about foreign tables
Date: 2023-10-20 08:27:00
Message-ID: 871qdp3dij.fsf@mbork.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On 2023-10-18, at 18:14, Ron <ronljohnsonjr(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Marcin Borkowski 2023-10-20 08:29:25 Is postgres_fdw "safe"?
Previous Message Marcin Borkowski 2023-10-20 08:26:04 Re: A few questions about foreign tables