Re: \df+ and pg_proc query

From: <dev(at)archonet(dot)com>
To: thalis(at)cs(dot)pitt(dot)edu
Cc: dev(at)archonet(dot)com, pgsql-general(at)postgresql(dot)org
Subject: Re: \df+ and pg_proc query
Date: 2001-07-14 19:16:24
Message-ID: 1436.192.168.1.16.995138184.squirrel@mainbox.archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Fri, 13 Jul 2001, Richard Huxton wrote:
>
>> From: "Thalis A. Kalfigopoulos" <thalis(at)cs(dot)pitt(dot)edu>
>>
>> > I assume that there is in fact a difference between doing:
>> >
>> > \df+ <func_name>
>> >
>> > and:
>> >
>> > select oid,proname,prosrc from pg_proc where proname='func_name';

>> Start psql with -E and then do \df+ to see what query PG actually uses
>> (this works for any \command)
>
> I know that, but the question was: how come the \df doesn't show the
> plpgsql functions? Shouldn't it?

Not sure - the \xxx commands tend to be a union of various selects with conditions (\d doesn't show system tables for example).

I definitely get user-defined (plpgsql) functions showing up in \df+ but I haven't got any trigger functions to hand at the moment, so I can't say about that.

Try the psql -E and see how that differs from your query and then see what is spooking the \df - if you think it's a bug come back to the list (or maybe to -hackers) or post a report.

richardh=> \df foo
SELECT format_type(p.prorettype, NULL) as "Result", p.proname as "Function",
oidvectortypes(p.proargtypes) as "Arguments"
FROM pg_proc p
WHERE p.prorettype <> 0 and (pronargs = 0 or oidvectortypes(p.proargtypes) <> '')
AND p.proname ~ '^foo'
ORDER BY "Function", "Result", "Arguments"

My guess is prorettype<>0 is there to specifically exclude trigger functions (with return type opaque). You should be able to see from your function defn whether this is so.

You might want to check out phpPgAdmin, which is an Apache/PHP admin front end to PostgreSQL. I've just had a quick look at the 3.0 beta and it's shaping up nicely.

- Richard Huxton

In response to

Browse pgsql-general by date

  From Date Subject
Next Message dev 2001-07-14 19:58:02 Re: Nusphere/MySQL-AB arguing
Previous Message tom 2001-07-14 16:10:38 RE: Nusphere/MySQL-AB arguing