pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedWhere are user defined functions stored?
4+ messages / 2 participants
[nested] [flat]
* Where are user defined functions stored?
@ 2005-09-23 14:09 Hilary Forbes <hforbes@dmr.co.uk>
2005-09-23 14:40 ` Re: Where are user defined functions stored? Tom Lane <tgl@sss.pgh.pa.us>
2005-09-23 16:18 ` Re: Where are user defined functions stored? Hilary Forbes <hforbes@dmr.co.uk>
0 siblings, 2 replies; 4+ messages in thread
From: Hilary Forbes @ 2005-09-23 14:09 UTC (permalink / raw)
To: pgsql-sql
If I write a rule, I can easily see it by doing
select * from pg_rules;
and I also get to see all the rules I have created for my database. How can I easily get to see the definition of a user defined function please? I've searched through the online manual but failed to find the answer.
TAI
Hilary
Hilary Forbes
The DMR Information and Technology Group (www.dmr.co.uk)
Direct tel 01689 889950 Fax 01689 860330
DMR is a UK registered trade mark of DMR Limited
**********************************************************
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Where are user defined functions stored?
2005-09-23 14:09 Where are user defined functions stored? Hilary Forbes <hforbes@dmr.co.uk>
@ 2005-09-23 14:40 ` Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 0 replies; 4+ messages in thread
From: Tom Lane @ 2005-09-23 14:40 UTC (permalink / raw)
To: Hilary Forbes <hforbes@dmr.co.uk>; +Cc: pgsql-sql
Hilary Forbes <hforbes@dmr.co.uk> writes:
> How can I easily get to see the definition of a user defined function
> please?
Look in pg_proc.
regards, tom lane
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Where are user defined functions stored?
2005-09-23 14:09 Where are user defined functions stored? Hilary Forbes <hforbes@dmr.co.uk>
@ 2005-09-23 16:18 ` Hilary Forbes <hforbes@dmr.co.uk>
2005-09-23 16:22 ` Re: Where are user defined functions stored? Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 1 reply; 4+ messages in thread
From: Hilary Forbes @ 2005-09-23 16:18 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-sql
Tom
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?
Hilary
At 10:40 23/09/2005 -0400, you wrote:
>Hilary Forbes <hforbes@dmr.co.uk> writes:
>> How can I easily get to see the definition of a user defined function
>> please?
>
>Look in pg_proc.
>
> regards, tom lane
>
>---------------------------(end of broadcast)---------------------------
>TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq
Hilary Forbes
The DMR Information and Technology Group (www.dmr.co.uk)
Direct tel 01689 889950 Fax 01689 860330
DMR is a UK registered trade mark of DMR Limited
**********************************************************
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Where are user defined functions stored?
2005-09-23 14:09 Where are user defined functions stored? Hilary Forbes <hforbes@dmr.co.uk>
2005-09-23 16:18 ` Re: Where are user defined functions stored? Hilary Forbes <hforbes@dmr.co.uk>
@ 2005-09-23 16:22 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 4+ messages in thread
From: Tom Lane @ 2005-09-23 16:22 UTC (permalink / raw)
To: Hilary Forbes <hforbes@dmr.co.uk>; +Cc: pgsql-sql
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
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2005-09-23 16:22 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-09-23 14:09 Where are user defined functions stored? Hilary Forbes <hforbes@dmr.co.uk>
2005-09-23 14:40 ` Tom Lane <tgl@sss.pgh.pa.us>
2005-09-23 16:18 ` Hilary Forbes <hforbes@dmr.co.uk>
2005-09-23 16:22 ` Tom Lane <tgl@sss.pgh.pa.us>
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