pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marcin Borkowski <mbork@mbork.pl>
To: Ron <ronljohnsonjr@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: A few questions about foreign tables
Date: Fri, 20 Oct 2023 10:27:00 +0200
Message-ID: <871qdp3dij.fsf@mbork.pl> (raw)
In-Reply-To: <66971fc2-d49c-4c50-a8bb-a185fd543fa1@gmail.com>
References: <87bkcws5i3.fsf@mbork.pl>
	<4e7b5deef8b8e5e603bcb9dc32fc20e84bb95419.camel@cybertec.at>
	<66971fc2-d49c-4c50-a8bb-a185fd543fa1@gmail.com>


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





view thread (5+ messages)

Message-ID: <871qdp3dij.fsf@mbork.pl>
Permalink:  ../871qdp3dij.fsf@mbork.pl/
Also on:    postgresql.org/message-id/871qdp3dij.fsf@mbork.pl

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: mbork@mbork.pl, ronljohnsonjr@gmail.com
  Subject: Re: A few questions about foreign tables
  In-Reply-To: <871qdp3dij.fsf@mbork.pl>
  References: <87bkcws5i3.fsf@mbork.pl> <4e7b5deef8b8e5e603bcb9dc32fc20e84bb95419.camel@cybertec.at> <66971fc2-d49c-4c50-a8bb-a185fd543fa1@gmail.com> <871qdp3dij.fsf@mbork.pl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox