Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jA76B-0008EL-Gs for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Mar 2020 07:08:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jA76A-000703-Dd for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Mar 2020 07:08:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jA76A-0006zw-4D for pgsql-hackers@lists.postgresql.org; Fri, 06 Mar 2020 07:08:42 +0000 Received: from out0-149.mail.aliyun.com ([140.205.0.149]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jA766-0000Nk-Ru for pgsql-hackers@postgresql.org; Fri, 06 Mar 2020 07:08:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alibaba-inc.com; s=default; t=1583478512; h=From:Message-Id:Content-Type:Mime-Version:Subject:Date:To; bh=WiNs3CTWXkrOr+QA9z2+Kt2WWX/wJDNt8wLykhnSqx4=; b=Mqd5nuz/mCg2fKxqx/275Zl5kaLo4mv3+vpJF8xah3JjYDbhxmSpRRPUxLN+rScYspcmUzcfL7rYkdxUb4ZiJKf3aFT5MnsnwrEpzCCTzWb3umZnq9bWoGYxu4S0pgkzlOkGUShVPa5vFMkr96tMoK1waLLCeB6IbhOqQDjFyHQ= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R201e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e02c03278;MF=wenjing.zwj@alibaba-inc.com;NM=1;PH=DS;RN=10;SR=0;TI=SMTPD_---.Gwzak0P_1583478510; Received: from 30.15.248.215(mailfrom:wenjing.zwj@alibaba-inc.com fp:SMTPD_---.Gwzak0P_1583478510) by smtp.aliyun-inc.com(127.0.0.1); Fri, 06 Mar 2020 15:08:30 +0800 From: "=?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?=" Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_53092AF0-80AC-49F8-A4E4-8273A946B88C" Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Subject: Re: [Proposal] Global temporary tables Date: Fri, 06 Mar 2020 15:08:30 +0800 In-Reply-To: <732351da-dcd6-ecb0-6017-db93df14b5f9@enterprisedb.com> Cc: "Prabhat Sahu" , "Pavel Stehule" , "Robert Haas" , "Tomas Vondra" , "Konstantin Knizhnik" , "PostgreSQL Hackers" , "=?UTF-8?B?6JSh5p2+6ZyyKOWtkOWYiSk=?=" , "=?UTF-8?B?Q2FpLCBMZQ==?=" , "=?UTF-8?B?6JCn5bCR6IGqKOmTgeW6tSk=?=" To: tushar References: <24099f4e-742c-e92b-729c-77bac1ca80d4@postgrespro.ru> <8BC7841E-3B32-4518-9586-D9ED571F4922@alibaba-inc.com> <35A2DF75-05A8-4F8D-9D43-A930E2ABDFDD@alibaba-inc.com> <82851B35-E2FB-4A5D-AF35-A2B5023DB9F2@alibaba-inc.com> <77320A29-DC39-4EFE-A5E2-0A00F6A316E8@alibaba-inc.com> <732351da-dcd6-ecb0-6017-db93df14b5f9@enterprisedb.com> X-Mailer: Apple Mail (2.3608.60.0.2.5) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail=_53092AF0-80AC-49F8-A4E4-8273A946B88C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > 2020=E5=B9=B43=E6=9C=885=E6=97=A5 =E4=B8=8B=E5=8D=8810:19=EF=BC=8Ctushar= =E5=86=99=E9=81=93=EF=BC=9A >=20 > On 3/3/20 2:10 PM, =E6=9B=BE=E6=96=87=E6=97=8C(=E4=B9=89=E4=BB=8E) = wrote: >> I fixed in global_temporary_table_v16-pg13.patch. > Please refer this scenario - >=20 > --Connect to psql - >=20 > postgres=3D# alter system set max_active_global_temporary_table =3D1; > ALTER SYSTEM >=20 > --restart the server (./pg_ctl -D data restart)=20 >=20 > --create global temp table=20 >=20 > postgres=3D# create global temp table ccc1 (c int); > CREATE TABLE >=20 > --Try to Create another global temp table >=20 > postgres=3D# create global temp table ccc2 (c int); > WARNING: relfilenode 13589/1663/19063 not exist in gtt shared hash = when forget > ERROR: out of shared memory > HINT: You might need to increase max_active_gtt. >=20 > postgres=3D# show max_active_gtt; > ERROR: unrecognized configuration parameter "max_active_gtt" > postgres=3D#=20 > postgres=3D# show max_active_global_temporary_table ; > max_active_global_temporary_table=20 > ----------------------------------- > 1 > (1 row) >=20 > postgres=3D#=20 >=20 > I cannot find "max_active_gtt" GUC . I think you are referring to = "max_active_global_temporary_table" here ?=20 >=20 You're right. Fixed in global_temporary_table_v17-pg13.patch Wenjing > also , would be great if we can make this error message user = friendly like - "max connection reached" rather than memory error >=20 > --=20 > regards,tushar > EnterpriseDB https://www.enterprisedb.com/ = > The Enterprise PostgreSQL Company --Apple-Mail=_53092AF0-80AC-49F8-A4E4-8273A946B88C Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

2020=E5=B9=B43=E6=9C=885=E6=97=A5 =E4=B8=8B=E5=8D=8810:19=EF=BC= =8Ctushar <tushar.ahuja@enterprisedb.com> =E5=86=99=E9=81=93=EF=BC=9A=

=20 =20
On 3/3/20 2:10 PM, =E6=9B=BE=E6=96=87=E6= =97=8C(=E4=B9=89=E4=BB=8E) wrote:
I fixed = in global_temporary_table_v16-pg13.patch.

Please refer this scenario -

--Connect to psql -

postgres=3D# alter system set = max_active_global_temporary_table =3D1;
ALTER SYSTEM

--restart the server (./pg_ctl -D data restart) =

--create global temp table

postgres=3D# create global temp  table = ccc1  (c int);
CREATE TABLE

--Try to Create another global temp table

postgres=3D# create global = temp  table ccc2  (c int);
WARNING:  relfilenode 13589/1663/19063 not = exist in gtt shared hash when forget
ERROR:  out of shared memory
HINT:  You might need to increase = max_active_gtt.

postgres=3D# show max_active_gtt;
ERROR:  unrecognized configuration parameter = "max_active_gtt"
postgres=3D#
postgres=3D# show max_active_global_temporary_table ;
=  max_active_global_temporary_table
-----------------------------------
 1
(1 row)

postgres=3D#

I cannot find "max_active_gtt"  GUC . I think = you are referring to  "max_active_global_temporary_table" here ?

You're right.

Fixed = in global_temporary_table_v17-pg13.patch


Wenjing


also , would be great  if we can make this = error message  user friendly like  - "max connection reached"  rather than = memory error

--=20
regards,tushar
EnterpriseDB  https://www.enterprisedb.com/
The Enterprise PostgreSQL Company

= --Apple-Mail=_53092AF0-80AC-49F8-A4E4-8273A946B88C--