X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 306E1D8E31 for ; Fri, 23 Sep 2005 13:22:44 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 13570-01 for ; Fri, 23 Sep 2005 16:22:40 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 75DA5D709A for ; Fri, 23 Sep 2005 13:22:39 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j8NGMXmK004680; Fri, 23 Sep 2005 12:22:33 -0400 (EDT) To: Hilary Forbes Cc: Pgsql-sql@postgresql.org Subject: Re: Where are user defined functions stored? 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> Comments: In-reply-to Hilary Forbes message dated "Fri, 23 Sep 2005 17:18:22 +0100" Date: Fri, 23 Sep 2005 12:22:33 -0400 Message-ID: <4679.1127492553@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 required=5 tests=[AWL=0.006] X-Spam-Level: X-Archive-Number: 200509/231 X-Sequence-Number: 22778 Hilary Forbes 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