[v10] CREATE TEMP FUNCTION/CREATE FUNCTION PG_TEMP.X

From: Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>
To: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: [v10] CREATE TEMP FUNCTION/CREATE FUNCTION PG_TEMP.X
Date: 2017-12-21 16:28:20
Message-ID: CAHjZ2x72-3sSX1Nj-05WguMpp4itUacNHB+96wss5EU31UnaiA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeremy Finzel 2017-12-21 16:46:45 Re: Deadlock with one table - PostgreSQL is doing it right
Previous Message Matt Zagrabelny 2017-12-21 16:11:11 Re: problems with postgresql 10.1 hba_conf on fedora 27