Re: Schema name of function - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Schema name of function
Date
Msg-id 28896.1108397513@sss.pgh.pa.us
Whole thread Raw
In response to Re: Schema name of function  (Michael Fuhr <mike@fuhr.org>)
Responses Re: Schema name of function  (Michael Fuhr <mike@fuhr.org>)
List pgsql-hackers
Michael Fuhr <mike@fuhr.org> writes:
> On Mon, Feb 14, 2005 at 07:32:15PM +1100, John Hansen wrote:
>> Is there a way for a C function to determine the name of the
>> schema in which is was created?

> Dunno if there's anything as simple as whats_my_schema(), but
> fcinfo->flinfo->fn_oid should contain the function's oid.  If nobody
> mentions an easier way, you could use SPI to query pg_proc and
> pg_namespace.

In C, it'd be a lot easier (and faster) to do a couple of SearchSysCache
calls than to use SPI to get those rows.
        regards, tom lane


pgsql-hackers by date:

Previous
From: pgsql@mohawksoft.com
Date:
Subject: Re: Query optimizer 8.0.1 (and 8.0)
Next
From: Bruce Momjian
Date:
Subject: Re: [GENERAL] WARNING: could not remove database directory