Re: Create temporary function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Create temporary function
Date: 2008-04-23 18:33:52
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Steve Crawford <scrawford(at)pinpointresearch(dot)com> writes:
> I have recently run across situations that might benefit from the
> ability to create a temporary function.

You can do that today, as long as you don't mind schema-qualifying
uses of the function:

regression=# create function pg_temp.tfunc(int) returns int as
regression-# $$ select $1 + 1 $$ language sql;
regression=# select pg_temp.tfunc(42);
(1 row)

Without the qualification, the function won't be found, even if
you put pg_temp into your search path explicitly. That's intentional
because of the risk of trojan horses ...

regards, tom lane

In response to


Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2008-04-23 18:37:04 Re: query question really cant give a summary here so read the body ; -)
Previous Message Steve Crawford 2008-04-23 18:20:36 Create temporary function