[v10] CREATE TEMP FUNCTION/CREATE FUNCTION PG_TEMP.X - Mailing list pgsql-general

From Vincenzo Romano
Subject [v10] CREATE TEMP FUNCTION/CREATE FUNCTION PG_TEMP.X
Date
Msg-id CAHjZ2x72-3sSX1Nj-05WguMpp4itUacNHB+96wss5EU31UnaiA@mail.gmail.com
Whole thread Raw
Responses Re: [v10] CREATE TEMP FUNCTION/CREATE FUNCTION PG_TEMP.X
List pgsql-general
Hi all.
It seems I cannot use a temporary function.
I know there's no "CREATE TEMP FUNCTION".
But while I can do

tmp2=# CREATE FUNCTION pg_temp.x( OUT b BOOL )
language PLPGSQL
AS $L0$
BEGIN
  b := TRUE;
END;
$L0$;
SET search_path TO pg_temp,"$user", public;

the following fails:

tmp2=# SELECT * FROM x();
LINE 1: select * from x();
                      ^
HINT:  No function matches the given name and argument types. You
might need to add explicit type casts.
tmp2=# \df+ x

  List of functions
Schema | Name | Result data type | Argument data types | Type |
Volatility | Parallel | Owner | Security | Access privileges |
Language | Source code | Description

--------+------+------------------+---------------------+------+------------+----------+-------+----------+-------------------+----------+-------------+-------------
(0 rows)

tmp2=# \df+ pg_temp.x

  List of functions
Schema | Name | Result data type | Argument data types | Type |
Volatility | Parallel | Owner | Security | Access privileges |
Language | Source code | Description

--------+------+------------------+---------------------+------+------------+----------+-------+----------+-------------------+----------+-------------+-------------
(0 rows)

but this succeeds:

tmp2=# select * from pg_temp.x();
 b
---
 t
(1 row)

I think I am doing/thinking something wrong.
But what?

TALIA!

-- 
Vincenzo Romano - NotOrAnd.IT
Information Technologies
--
NON QVIETIS MARIBVS NAVTA PERITVS


pgsql-general by date:

Previous
From: Matt Zagrabelny
Date:
Subject: Re: problems with postgresql 10.1 hba_conf on fedora 27
Next
From: Jeremy Finzel
Date:
Subject: Re: Deadlock with one table - PostgreSQL is doing it right