pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Hilary Forbes <hforbes@dmr.co.uk>
Cc: Pgsql-sql@postgresql.org
Subject: Re: Where are user defined functions stored?
Date: Fri, 23 Sep 2005 12:22:33 -0400
Message-ID: <4679.1127492553@sss.pgh.pa.us> (raw)
In-Reply-To: <5.1.0.14.0.20050923171510.0205bc40@mailserver.dmr.co.uk>
References: <5.1.0.14.0.20050923150802.03484f38@mailserver.dmr.co.uk>
	<5.1.0.14.0.20050923150802.03484f38@mailserver.dmr.co.uk>
	<5.1.0.14.0.20050923171510.0205bc40@mailserver.dmr.co.uk>

Hilary Forbes <hforbes@dmr.co.uk> writes:
> Many thanks.  Suppose I now want to know if there are any user defined functions set up in my database?  I was rather hoping I could do something simple like
> \df
> to get a list of **user** defined functions rather as \dt gives me a list of my tables and not the complete list of all the system tables as well.  Is there a way of achieving this?

You could do something like
	\df public.*
although if your functions are scattered through a bunch of different
schemas it'd get a bit tedious.  Or try looking at the catalog for
yourself, eg

select oid::regprocedure, prosrc from pg_proc
where pronamespace != (select oid from pg_namespace
                       where nspname = 'pg_catalog');

This essentially implements the rule "system functions are those in
pg_catalog".  You might want to exclude stuff in information_schema
as well.

			regards, tom lane



view thread (4+ messages)

Message-ID: <4679.1127492553@sss.pgh.pa.us>
Permalink:  ../4679.1127492553@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4679.1127492553@sss.pgh.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, hforbes@dmr.co.uk
  Subject: Re: Where are user defined functions stored?
  In-Reply-To: <4679.1127492553@sss.pgh.pa.us>

* 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