Re: [Proposal] Global temporary tables

From: 曾文旌 <wenjing(dot)zwj(at)alibaba-inc(dot)com>
To: Prabhat Sahu <prabhat(dot)sahu(at)enterprisedb(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, tushar <tushar(dot)ahuja(at)enterprisedb(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>
Subject: Re: [Proposal] Global temporary tables
Date: 2020-04-29 03:22:42
Message-ID: EF2F5759-B076-428B-8952-29D54CE46076@alibaba-inc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> 2020年4月27日 下午9:48,Prabhat Sahu <prabhat(dot)sahu(at)enterprisedb(dot)com> 写道:
>
> Thanks Wenjing, for the fix patch for previous issues.
> I have verified the issues, now those fix look good to me.
> But the below error message is confusing(for gtt2).
>
> postgres=# drop table gtt1;
> ERROR: cannot drop global temp table gtt1 when other backend attached it.
>
> postgres=# drop table gtt2;
> ERROR: cannot drop index idx2 on global temp table gtt2 when other backend attached it.
>
> I feel the above error message shown for "DROP TABLE gtt2;" is a bit confusing(looks similar to DROP INDEX gtt2;).
> If possible, can we keep the error message simple as "ERROR: cannot drop global temp table gtt2 when other backend attached it."?
> I mean, without giving extra information for the index attached to that GTT.
Fixed the error message to make the expression more accurate. In v33.

Wenjing

>
> On Mon, Apr 27, 2020 at 5:34 PM 曾文旌 <wenjing(dot)zwj(at)alibaba-inc(dot)com <mailto:wenjing(dot)zwj(at)alibaba-inc(dot)com>> wrote:
>
>
>> 2020年4月27日 下午5:26,Prabhat Sahu <prabhat(dot)sahu(at)enterprisedb(dot)com <mailto:prabhat(dot)sahu(at)enterprisedb(dot)com>> 写道:
>>
>> Hi Wenjing,
>>
>> Please check the below scenario shows different error message with "DROP TABLE gtt;" for gtt with and without index.
>> -- Session1:
>> postgres=# create global temporary table gtt1 (c1 int);
>> CREATE TABLE
>> postgres=# create global temporary table gtt2 (c1 int);
>> CREATE TABLE
>> postgres=# create index idx2 on gtt2(c1);
>> CREATE INDEX
>>
>> -- Session2:
>> postgres=# drop table gtt1;
>> ERROR: can not drop relation gtt1 when other backend attached this global temp table
>> postgres=# drop table gtt2;
>> ERROR: can not drop index gtt2 when other backend attached this global temp table.
> For DROP GTT, we need to drop the index on the table first.
> So the indexes on the GTT are checked first.
> But the error message needs to be fixed.
> Fixed in v32
>
>
> wenjing
>
>
>
>
>>
>> --
>> With Regards,
>> Prabhat Kumar Sahu
>> EnterpriseDB: http://www.enterprisedb.com <http://www.enterprisedb.com/>
>
>
>
> --
> With Regards,
> Prabhat Kumar Sahu
> EnterpriseDB: http://www.enterprisedb.com <http://www.enterprisedb.com/>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rui DeSousa 2020-04-29 04:19:05 Re: PostgreSQL CHARACTER VARYING vs CHARACTER VARYING (Length)
Previous Message Amit Kapila 2020-04-29 03:18:42 Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions