Re: Way to check for function existance

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jim C(dot) Nasby" <decibel(at)decibel(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Way to check for function existance
Date: 2004-11-23 22:22:10
Message-ID: 790.1101248530@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Jim C. Nasby" <decibel(at)decibel(dot)org> writes:
> I'm also working on trying to do a select out of pg_proc, but I'm not
> having a lot of luck there either...

> # select oid,* from pg_proc where proname='user_write_lock_oid' and
> proargtypes = ARRAY((SELECT oid FROM pg_type WHERE
> typname='oid'))::oidvector;
> ERROR: cannot cast type oid[] to oidvector

For standard types like OID, it's probably easiest just to hardwire the
oidvector value:
select ...
where proname='user_write_lock_oid' and pronargs = 1 and proargtypes = '26';
Note you should include the pronargs test to allow this to match the
index on pg_proc.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2004-11-23 22:28:57 Re: Upcoming Changes to News Server ...
Previous Message Jim Seymour 2004-11-23 22:17:39 Re: Upcoming Changes to News Server ...