Re: PL/PgSQL and pg_temp pseudo-schema

From: Melvin Davidson <melvin6925(at)gmail(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: PL/PgSQL and pg_temp pseudo-schema
Date: 2015-02-20 19:22:10
Message-ID: CANu8FiyWgXYWXbmje2LHHjXiDGELycvjbdOya5Ny+JU3QsMaPw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Take note. Temp tables are only visable, available to the sessions that
created them. You cannot access them from a different session. Is that the
problem you experience> If not, please provide a specific example of what
your problem is.

On Fri, Feb 20, 2015 at 3:34 AM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
wrote:

> Hi
>
> It is little bit strange, it works for me
>
> postgres=# create temp table foo(a int);
> CREATE TABLE
> postgres=# do $$ begin insert into foo values(10); end $$; -- plpgsql
> DO
> postgres=# select * from foo;
> a
> ----
> 10
> (1 row)
>
> Regards
>
> Pavel
>
>
>
> 2015-02-20 9:07 GMT+01:00 Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>:
>
>> PL/PgSQL doesn't know the pg_temp meta schema in case you need to
>> really work on that TEMP TABLE.
>> At the moment I had to move those DDL/DML queries within a "plain" SQL
>> function.
>>
>> Is this a feature or a bug? (Seriously, I mean! :-)
>>
>> TIA.
>>
>> --
>> Vincenzo Romano - NotOrAnd.IT
>> Information Technologies
>> --
>> NON QVIETIS MARIBVS NAVTA PERITVS
>>
>>
>> --
>> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-general
>>
>
>

--
*Melvin Davidson*
I reserve the right to fantasize. Whether or not you
wish to share my fantasy is entirely up to you.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael_LT 2015-02-20 19:57:37 how to convert "output deleted/inserted into" in My SQL to Postgres
Previous Message Juan Pablo L 2015-02-20 16:27:03 Re: rollback in C functions