Thread: function lookup using a "real" function call

function lookup using a "real" function call

From
"Marc Mamin"
Date:
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


Re: function lookup using a "real" function call

From
raghu ram
Date:


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