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: tushar <tushar(dot)ahuja(at)enterprisedb(dot)com>, 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-04-07 08:51:01
Message-ID: A7219CA2-B12B-4F3A-A683-12D9756A38A6@alibaba-inc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> 2020年4月3日 下午8:43,Prabhat Sahu <prabhat(dot)sahu(at)enterprisedb(dot)com> 写道:
>
> Hi Wenjing,
>
> Please check the allowed values for boolean parameter "on_commit_delete_rows".
>
> postgres=# create global temp table gtt1(c1 int) with(on_commit_delete_rows='true');
> CREATE TABLE
> Similarly we can successfully create GTT by using the values as: 'true','false', true, false, 'ON', 'OFF', ON, OFF, 1, 0 for boolean parameter "on_commit_delete_rows"
>
> But we are getting error while using the boolean value as: '1', '0', 't', 'f', 'yes', 'no', 'y', 'n' as below.
> postgres=# create global temp table gtt11(c1 int) with(on_commit_delete_rows='1');
> ERROR: on_commit_delete_rows requires a Boolean value
> postgres=# create global temp table gtt11(c1 int) with(on_commit_delete_rows='0');
> ERROR: on_commit_delete_rows requires a Boolean value
> postgres=# create global temp table gtt11(c1 int) with(on_commit_delete_rows='t');
> ERROR: on_commit_delete_rows requires a Boolean value
> postgres=# create global temp table gtt11(c1 int) with(on_commit_delete_rows='f');
> ERROR: on_commit_delete_rows requires a Boolean value
> postgres=# create global temp table gtt11(c1 int) with(on_commit_delete_rows='yes');
> ERROR: on_commit_delete_rows requires a Boolean value
> postgres=# create global temp table gtt11(c1 int) with(on_commit_delete_rows='no');
> ERROR: on_commit_delete_rows requires a Boolean value
> postgres=# create global temp table gtt11(c1 int) with(on_commit_delete_rows='y');
> ERROR: on_commit_delete_rows requires a Boolean value
> postgres=# create global temp table gtt11(c1 int) with(on_commit_delete_rows='n');
> ERROR: on_commit_delete_rows requires a Boolean value
Thanks for review.
This parameter should support all types of writing of the bool type like parameter autovacuum_enabled.
So I fixed in global_temporary_table_v24-pg13.patch.

Wenjing

>
> -- As per the error message "ERROR: on_commit_delete_rows requires a Boolean value" either we should allow all the boolean values.
> Example: CREATE VIEW view1 WITH (security_barrier = 'true') as select 5;
> The syntax of VIEW allows all the above possible boolean values for the boolean parameter "security_barrier"
>
> -- or else we should change the error message something like
> "ERROR: on_commit_delete_rows requires 'true','false','ON','OFF',1,0 as Boolean value".
>
> --
> 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 曾文旌 2020-04-07 08:57:57 Re: [Proposal] Global temporary tables
Previous Message Amit Kapila 2020-04-07 08:42:01 Re: pg_stat_statements issue with parallel maintenance (Was Re: WAL usage calculation patch)