function lookup using a "real" function call

Started by Marc Maminalmost 14 years ago2 messagesgeneral
Jump to latest
#1Marc Mamin
M.Mamin@intershop.de

Hello,

Is it possible to find out the (list of) function oids from a function
call?

e.g. select MYFUNC('foo', 1234)

=> someting like

select * from get_function_oids($$MYFUNC('foo', 1234)$$)

best regards,

Marc Mamin

#2raghu ram
raghuchennuru@gmail.com
In reply to: Marc Mamin (#1)
Re: function lookup using a "real" function call

On Thu, Jun 28, 2012 at 3:30 PM, Marc Mamin <M.Mamin@intershop.de> wrote:

Hello,

Is it possible to find out the (list of) function oids from a function
call?

e.g. select MYFUNC('foo', 1234)

=> someting like

select * from get_function_oids($$MYFUNC('foo', 1234)$$)

Below approach provides information of the OID of the function::

postgres=# create function myfunc(int) returns int as 'select $1' language
sql;
CREATE FUNCTION

postgres=# SELECT 'myfunc(int)'::regprocedure::oid;
oid
-------
24612
(1 row)

postgres=# select 24612::regprocedure;
regprocedure
-----------------
myfunc(integer)

--

Thanks & Regards,

Raghu Ram