Re: Schema name of function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: John Hansen <john(at)geeknet(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Schema name of function
Date: 2005-02-14 16:11:53
Message-ID: 28896.1108397513@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Fuhr <mike(at)fuhr(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2005-02-14 16:25:10 Re: [GENERAL] WARNING: could not remove database directory
Previous Message pgsql 2005-02-14 14:11:10 Re: Query optimizer 8.0.1 (and 8.0)