From: Vik Fearing <vik.fearing@2ndquadrant.com>
To: Benjie Gillam <benjie@jemjie.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Detecting functions installed by an extension
Date: Sun, 17 Jun 2018 10:26:23 +0200
Message-ID: <352f05f3-6270-f160-3138-e66078d620e3@2ndquadrant.com> (raw)
In-Reply-To: <CAMThMzG0TmH9a8bLn4jViMnf-Og_cXk+2_q3O9N6vtv3Hrrxpg@mail.gmail.com>
References: <CAMThMzG0TmH9a8bLn4jViMnf-Og_cXk+2_q3O9N6vtv3Hrrxpg@mail.gmail.com>
On 17/06/18 10:05, Benjie Gillam wrote:
> Greetings!
>
> How can I tell, using the system catalog or information schema, if a
> function/procedure was created by an extension as opposed to by the user
> (i.e. would be dropped if you performed "DROP EXTENSION")? So far I've
> looked at the `pg_extension` table, which lists the class IDs of
> configuration tables but doesn't mention procedures. I've looked at
> `pg_proc` but that doesn't seem to contain the information. I've also
> scanned over various other system catalogues but with no luck. Is this
> information available in one of the system catalogs? Does PostgreSQL
> itself track this information so that it can perform cleanup, or does it
> expect the extension to clean up after itself?
All dependencies are tracked in the system catalog pg_depend.
If you do \set ECHO_HIDDEN on in psql and then \dx+ an_extension you
can see what queries psql uses to get the information. That should put
you well on your way to doing what you want.
--
Vik Fearing +33 6 46 75 15 36
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support
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: vik.fearing@2ndquadrant.com, benjie@jemjie.com
Subject: Re: Detecting functions installed by an extension
In-Reply-To: <352f05f3-6270-f160-3138-e66078d620e3@2ndquadrant.com>
References: <CAMThMzG0TmH9a8bLn4jViMnf-Og_cXk+2_q3O9N6vtv3Hrrxpg@mail.gmail.com> <352f05f3-6270-f160-3138-e66078d620e3@2ndquadrant.com>
* 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