Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jRxz9-00082A-GI for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Apr 2020 13:03:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jRxz8-0000vx-Cw for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Apr 2020 13:03:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jRxz8-0000vo-5h for pgsql-hackers@lists.postgresql.org; Fri, 24 Apr 2020 13:03:14 +0000 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jRxz5-0000TZ-L6 for pgsql-hackers@postgresql.org; Fri, 24 Apr 2020 13:03:13 +0000 Received: by mail-pl1-x642.google.com with SMTP id t4so3692322plq.12 for ; Fri, 24 Apr 2020 06:03:11 -0700 (PDT) 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-transfer-encoding:content-language; bh=1lwKJL2GVk/wQOYJJr36xblYgDzHAMnR485iRZbkfqY=; b=dYFkuqqU0hVJmbfIEYYO5LGMLgRxOeHXM2GlNh3fJCvc+MPMUJM0vYuBJqn67cuUAa yC/Cuu6C/7q8Hgnah+W1XrrzgrwvaIaA8CM8GgENK4MuEufrBl/qr03hbk6KqrR+Ga4O eN/2Gogtp6xnahMlePbu0Cz5Q4f0AdjqCF2SotrPcMj8qoMlLsGWSNZSXYbaxkNPh3Pc DMTFOWZDWw29aTq2tRTTT0ePAwO+ohuSkx0p3/NrkLMZ1NfG/fVDu/cznoYHdZ3OiRQt kQNl5nvW3N09Klxv2d0N6KNchyb/H9R808xA2JXTWpP++Kvgov60Av/n4fcs+YUAStjL mddg== 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-transfer-encoding :content-language; bh=1lwKJL2GVk/wQOYJJr36xblYgDzHAMnR485iRZbkfqY=; b=WJZV5dxVt8/N2tDQTDhbD3rFUd2u4BZoEf63CWIVDoLg6IAobQI683zLDx/ARpRZtA NJIrOCCQzpakL+F10WpUDr5Z3O0vpQQLT20H0vTJYjGdfhFoUlIhfYsE3b+FmxO6CBod HYVBHpG7gGkrq3WLfsRecLktnJHFy5/AXmqWklI64bNjLT5Nzue1riO4asI/wzlc23Si GM2mJV44BSmJE1mxywlErm+JBZOLQxCY514YFzyQT11NRkFygnGdAgxKTH+t6XHn+DZI 6C2z8y7AqiWUZMwpo9i00bM60cg9rwMhVLxntHy3lJdxNUCtUOmEEB8UmueEhV12btf8 KO5w== X-Gm-Message-State: AGi0Pua1Iofkhfl/TKrEm9WxGtiG6dZD8cwlbbB45+leK3DqB/v4HyE6 klq7IyO9eK6wnYD3GoeYLXFiRG+4XhxSzCUXs1J1dX3eYZSTnlqatwzmwcCLCewbdrcimgkf6LM V3Du0a+x6e4fOji2YmIdH3YGy3O5+vSnDwf0AnMY+EP5RCNZpz1lHY22Iq0v1DsnLZJLFc42Iye Q1S2d5emSnDjIEaN4Uvserq84bc9evIwt8ZyjM X-Google-Smtp-Source: APiQypKb5HmLp3NaYCfiRzAiLvRhcWc9bdb7AYQdp7YWQpwjly96xnxYpU39jPvbmb2kIa1Fo9LnvQ== X-Received: by 2002:a17:902:9308:: with SMTP id bc8mr9352550plb.278.1587733389142; Fri, 24 Apr 2020 06:03:09 -0700 (PDT) Received: from localhost.localdomain ([45.113.251.168]) by smtp.gmail.com with ESMTPSA id p189sm5890212pfp.135.2020.04.24.06.03.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Apr 2020 06:03:08 -0700 (PDT) Subject: Re: [Proposal] Global temporary tables To: =?UTF-8?B?5pu+5paH5peM?= , Pavel Stehule , Prabhat Sahu , Robert Haas Cc: Tomas Vondra , Konstantin Knizhnik , PostgreSQL Hackers , =?UTF-8?B?6JSh5p2+6Zyy?= =?UTF-8?B?KOWtkOWYiSk=?= , "Cai, Le" References: <24099f4e-742c-e92b-729c-77bac1ca80d4@postgrespro.ru> <68FC0EB3-8E39-4300-B9ED-036F4163C791@alibaba-inc.com> <25D7E36F-B2D6-4A63-BFC7-E1FD24EA6BE0@alibaba-inc.com> <507b246f-4350-f4af-3950-a334be7c2cf2@enterprisedb.com> <06844F6A-0BD2-438E-95E5-E76E4CB5CA57@alibaba-inc.com> <750A0445-7FE0-4B4D-A319-AC1A8C7249EB@alibaba-inc.com> <9EBDB104-42CD-409E-BB27-D14AB0858AE4@alibaba-inc.com> From: tushar Message-ID: <18342268-cb9b-a879-2946-93dcfed02729@enterprisedb.com> Date: Fri, 24 Apr 2020 18:33:03 +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: <9EBDB104-42CD-409E-BB27-D14AB0858AE4@alibaba-inc.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-CLOUD-SEC-AV-Info: enterprisedb,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 On 4/22/20 2:49 PM, 曾文旌 wrote: > > I provide the TRUNCATE tablename DROP to clear the data in the GTT and > delete the storage files. > This feature requires the current transaction to commit immediately > after it finishes truncate. > Thanks Wenjing , Please refer this scenario postgres=# create global temp table testing (a int); CREATE TABLE postgres=# begin; BEGIN postgres=*# truncate testing;      -- working   [1] TRUNCATE TABLE postgres=*# truncate testing drop; ERROR:  Truncate global temporary table cannot run inside a transaction block    --that is throwing an error claiming something which i did  successfully [1] postgres=!# -- regards,tushar EnterpriseDB https://www.enterprisedb.com/ The Enterprise PostgreSQL Company