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 1j9rLs-0006k3-W5 for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Mar 2020 14:19:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j9rLr-0004ay-Nr for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Mar 2020 14:19:51 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j9rLr-0004Z9-7O for pgsql-hackers@lists.postgresql.org; Thu, 05 Mar 2020 14:19:51 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j9rLo-0007tw-C6 for pgsql-hackers@postgresql.org; Thu, 05 Mar 2020 14:19:50 +0000 Received: by mail-pf1-x443.google.com with SMTP id i19so2851550pfa.2 for ; Thu, 05 Mar 2020 06:19:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=a1nNPZStU6Z3SA9ErC4JNk/Cz6Ky+c61fY/vWkhzBrU=; b=SMpFwW8hZbfG1nGlFSluKDprJl/3XUlnx7CxxY8TbnyYN27SVtaO478Zzp/vqQ/Ygi cnf/m0z4KDRhSbUtvFDQkg30HnLJsbLtrP5yYocQskyIIGkQzdEiG7lnc902uuI7ahi5 nDvINGP+WBCvdwTq7unJQDBetT03vJftvbXwb7k+n1D522l6WE5JsRe/H59iirwEipRz 1sCgG8QkUgnv3CSBrjB7UVD0h0TrHjgznaDx9hyzlJIfKMyrf07+0VWTevm5wPE9TQJB tU1tv73gytWRbKRmCRrwV521FF1O8jDosG5r6ojGm10n2jyonrV0GhrKSe9zZ0lYbFQN KYaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=a1nNPZStU6Z3SA9ErC4JNk/Cz6Ky+c61fY/vWkhzBrU=; b=Doivez5cmaZU1+NX2LDeHZkH3m3K2sfZ9IMugaTLwNgRTxcUmz1JuJCR0C4F6nW8Tp ioy/zBuRNRznjHDpoqTWRItZxqbkzDOhwKrqrDjGilZ9bPgev5S+jahtCxvLB2G6uNVR fb3/Tor9QqIu14o8IOD9Z52C45y658y5ttmn5haCzBDkNRTLO7JFlpNyjVUfDOGDytx8 5EdhCtRocOetxYmh3tKBJsFBHoMmn2bkQOQ45CsSsq58MYGFIWDZaDGrO3Ym0G/QmAvr ZqsG8y5lN4zOhHEuzCca69jZZt5PVRSo2iPj151Jl0hL1ePyaTNCa2xeMlzrE+8CTYNK SuiQ== X-Gm-Message-State: ANhLgQ1i//3StPLnPk3QHlM585wO+5kTm4fOclb3C05L94asfuZ3zFyW xE35HEZRtxfGayighrbM6k1hsebzjqK5XWaWLipoH0yNWC/uLIGhr9ahJ/GGJUwrYsGGu7Fr958 +sqbgL7zYKkU9lFx4NE4+HGWSyjI0Mdiw6/EYPkAtiWE0c91bvAjIWCDS9703wkoAiCR7mRERSh plytmCjIJkDZeNEPKvcEXaax0q4ZuZwA== X-Google-Smtp-Source: ADFU+vuZps44bfwNs5CYAHLVaeS10nn8O6qbACMy9z2JEKLV6j2tUCnz43djjsv38zIb8QFsPWQ0qg== X-Received: by 2002:a63:714:: with SMTP id 20mr8356767pgh.271.1583417987073; Thu, 05 Mar 2020 06:19:47 -0800 (PST) Received: from localhost.localdomain ([114.143.109.178]) by smtp.gmail.com with ESMTPSA id y197sm17405105pfg.49.2020.03.05.06.19.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Mar 2020 06:19:46 -0800 (PST) Subject: Re: [Proposal] Global temporary tables To: =?UTF-8?B?5pu+5paH5peMKOS5ieS7jik=?= Cc: Prabhat Sahu , Pavel Stehule , Robert Haas , Tomas Vondra , Konstantin Knizhnik , PostgreSQL Hackers , =?UTF-8?B?6JSh5p2+6Zyy?= =?UTF-8?B?KOWtkOWYiSk=?= , "Cai, Le" , =?UTF-8?B?6JCn5bCR6IGqKOmTgeW6tSk=?= 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> From: tushar Message-ID: <732351da-dcd6-ecb0-6017-db93df14b5f9@enterprisedb.com> Date: Thu, 5 Mar 2020 19:49:37 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------B04951DE5E7379F5B80E8445" Content-Language: en-US X-CLOUD-SEC-AV-Info: edb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------B04951DE5E7379F5B80E8445 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 3/3/20 2:10 PM, 曾文旌(义从) wrote: > I fixed in global_temporary_table_v16-pg13.patch. Please refer this scenario - --Connect to psql - postgres=# alter system set max_active_global_temporary_table =1; ALTER SYSTEM --restart the server (./pg_ctl -D data restart) --create global temp table postgres=# create global temp  table ccc1  (c int); CREATE TABLE --Try to Create another global temp table *postgres=# 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=# show max_active_gtt; ERROR:  unrecognized configuration parameter "max_active_gtt" postgres=# postgres=# show max_active_global_temporary_table ;  max_active_global_temporary_table -----------------------------------  1 (1 row) postgres=# I cannot find "max_active_gtt"  GUC . I think you are referring to  "max_active_global_temporary_table" here ? also , would be great  if we can make this error message  user friendly like  - "max connection reached"  rather than memory error -- regards,tushar EnterpriseDB https://www.enterprisedb.com/ The Enterprise PostgreSQL Company --------------B04951DE5E7379F5B80E8445 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
On 3/3/20 2:10 PM, 曾文旌(义从) wrote:
I fixed in global_temporary_table_v16-pg13.patch.

Please refer this scenario -

--Connect to psql -

postgres=# alter system set max_active_global_temporary_table =1;
ALTER SYSTEM

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

--create global temp table

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

--Try to Create another global temp table

postgres=# 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=# show max_active_gtt;
ERROR:  unrecognized configuration parameter "max_active_gtt"
postgres=#
postgres=# show max_active_global_temporary_table ;
 max_active_global_temporary_table
-----------------------------------
 1
(1 row)

postgres=#

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

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

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