Re: Pl/pgsql function - Mailing list pgsql-general

From David Johnston
Subject Re: Pl/pgsql function
Date
Msg-id 007901cc22ce$444a9e50$ccdfdaf0$@yahoo.com
Whole thread Raw
In response to Pl/pgsql function  (Nick Raj <nickrajjain@gmail.com>)
List pgsql-general
>>From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of Nick Raj
>>Sent: Saturday, June 04, 2011 10:04 AM
>>To: pgsql-general@postgresql.org
>>Subject: [GENERAL] Pl/pgsql function
>>
>>Second thing,
>>Suppose i defined a function test as
>>
>>select test('geom',the_geom,time) from tablename
>>.....
>>Inside body,
>>How can i get the tablename inside the body (because i haven't pass table
name to function)
>>......
>>end

Not possible; a function only has access to the specific things you provide
it.  If you explain why you want the "tablename" maybe alternatives can be
suggested.  The only time you get access to the table name is when you are
executing the function in the context of a trigger.

David J.


pgsql-general by date:

Previous
From: Rob Sargent
Date:
Subject: Re: Pl/pgsql function
Next
From: Tom Lane
Date:
Subject: Re: Why are IDLE connections using cpu according to TOP.