Unix Technical Forum

getting oid of function

This is a discussion on getting oid of function within the pgsql Hackers forums, part of the PostgreSQL category; --> Hello all Is it possible to get the oid of a function on the basis of its name?. The ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-11-2008, 03:42 AM
Sibtay Abbas
 
Posts: n/a
Default getting oid of function

Hello all

Is it possible to get the oid of a function on the basis of its name?.

The scenario which i am currently facing is that i have the function name, now
i want search the pg_proc system catalog on the basis of the function
name and retrieve its Oid.

Another confusion which i am facing is that, I am not sure whether Oid
of a function is entered in pg_proc system catalog or not. Because i
am not able to identify any relevant field.

thank you

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-11-2008, 03:42 AM
Michael Fuhr
 
Posts: n/a
Default Re: getting oid of function

On Mon, Feb 14, 2005 at 05:02:19PM +0500, Sibtay Abbas wrote:
>
> Actually i ve introduced a new statement in plpgsql, that supports calling
> a plpgsql function from within a plpgsql function for example
>
> CALL function_name( <params>);


How would this differ from PERFORM?

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-11-2008, 03:43 AM
Sibtay Abbas
 
Posts: n/a
Default Re: getting oid of function

>How would this differ from PERFORM?

I think perform goes through the SQL by using SPI to execute the function,
where as this statement will invoke a plpgsql function without going
through the
sql ( :-) ..in case i manage to add this statement )

thankz alot for your replies

regards
Sibtay


On Tue, 15 Feb 2005 14:55:38 +1100, Neil Conway <neilc@samurai.com> wrote:
> On Mon, 2005-02-14 at 17:02 +0500, Sibtay Abbas wrote:
> > thank you for the detailed reply
> > But what i wanted to know is that how can we actually get a function's
> > oid from its
> > name from within postgresql code itself

>
> You'll want to query the syscache. Note that due to function
> overloading, there may be multiple functions with the same name, so
> you'll need to figure out which one ought to be invoked by using the
> number and types of the parameters. See FuncnameGetCandidates() in
> namespace.c for an example.
>
> -Neil
>
>


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-11-2008, 03:44 AM
Neil Conway
 
Posts: n/a
Default Re: getting oid of function

On Mon, 2005-02-14 at 17:02 +0500, Sibtay Abbas wrote:
> thank you for the detailed reply
> But what i wanted to know is that how can we actually get a function's
> oid from its
> name from within postgresql code itself


You'll want to query the syscache. Note that due to function
overloading, there may be multiple functions with the same name, so
you'll need to figure out which one ought to be invoked by using the
number and types of the parameters. See FuncnameGetCandidates() in
namespace.c for an example.

-Neil



---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:57 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com