Re: [Proposal] Global temporary tables

From: Prabhat Sahu <prabhat(dot)sahu(at)enterprisedb(dot)com>
To: 曾文旌(义从) <wenjing(dot)zwj(at)alibaba-inc(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, 蔡松露(子嘉) <zijia(at)taobao(dot)com>, "Cai, Le" <le(dot)cai(at)alibaba-inc(dot)com>, 萧少聪(铁庵) <shaocong(dot)xsc(at)alibaba-inc(dot)com>
Subject: Re: [Proposal] Global temporary tables
Date: 2020-02-24 09:44:34
Message-ID: CANEvxPqkJ8ubPcwZLP9m_4qdNmAo+LrJTt95-B9RbWhbZ-8Nsw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Feb 21, 2020 at 9:10 PM 曾文旌(义从) <wenjing(dot)zwj(at)alibaba-inc(dot)com> wrote:

> Hi,
> I have started testing the "Global temporary table" feature,
> That's great, I see hope.
> from "gtt_v11-pg13.patch". Below is my findings:
>
> -- session 1:
> postgres=# create global temporary table gtt1(a int);
> CREATE TABLE
>
> -- seeeion 2:
> postgres=# truncate gtt1 ;
> ERROR: could not open file "base/13585/t3_16384": No such file or
> directory
>
> is it expected?
>
> Oh ,this is a bug, I fixed it.
>
Thanks for the patch.
I have verified the same, Now the issue is resolved with v12 patch.

Kindly confirm the below scenario:

postgres=# create global temporary table gtt1 (c1 int unique);
CREATE TABLE

postgres=# create global temporary table gtt2 (c1 int references gtt1(c1) );
ERROR: referenced relation "gtt1" is not a global temp table

postgres=# create table tab2 (c1 int references gtt1(c1) );
ERROR: referenced relation "gtt1" is not a global temp table

Thanks,
Prabhat Sahu

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2020-02-24 09:58:03 allow trigger to get updated columns
Previous Message Oleksandr Shulgin 2020-02-24 08:52:21 Re: Make java client lib accept same connection strings as psql