Search Postgresql Archives

And what about temporary functions? (Was: How to drop a temporary view?)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2012/4/20 Tom Lane <tgl@xxxxxxxxxxxxx>:
> Vincenzo Romano <vincenzo.romano@xxxxxxxxxxx> writes:
>> The weirdness is that it doesn't produce any notice the first two times.
>> At the third invocation I see the notice coming out.
>
> I'd suggest tweaking the exception handler to print the error it caught;
> that would probably clarify what is happening.
>
>                        regards, tom lane

It looks like it works like this:

-- session 1
create or replace function pg_temp.f( out i int )
volatile
language plpgsql
as $l0$
begin
  i := 42;
end;
$l0$;
-- session 2
create or replace function pg_temp.f( out i int )
volatile
language plpgsql
as $l0$
begin
  i := 0;
end;
$l0$;
-- session 1
tmp1=# SELECT * from f();
ERROR:  function f() does not exist
LINE 1: SELECT * from f();
                      ^
HINT:  No function matches the given name and argument types. You
might need to add explicit type casts.
tmp1=# SELECT * from pg_temp.f();
 i
----
 42
(1 row)

Time: 0,301 ms

-- session 2
tmp1=# SELECT * from f();
ERROR:  function f() does not exist
LINE 1: SELECT * from f();
                      ^
HINT:  No function matches the given name and argument types. You
might need to add explicit type casts.
tmp1=# SELECT * from pg_temp.f();
 i
---
 0
(1 row)

Time: 0,252 ms
--

Why not using the implicit pg_temp_nnn as seen in views and tables?

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux