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 1jM82b-00080D-7j for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Apr 2020 10:34:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jM82Z-00073m-Gk for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Apr 2020 10:34:39 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jM82Z-0006v2-5S for pgsql-hackers@lists.postgresql.org; Wed, 08 Apr 2020 10:34:39 +0000 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jM82V-0006Yq-L0 for pgsql-hackers@postgresql.org; Wed, 08 Apr 2020 10:34:37 +0000 Received: by mail-lj1-x244.google.com with SMTP id g27so7012484ljn.10 for ; Wed, 08 Apr 2020 03:34:34 -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=G0r/zbgYPnEyflyD7XccyjW+MtrIqPXED0JW8pPaR1k=; b=CHOzzCAxm2l6kiGE9ANyj/dT9CMsxpD7dltXqYUMA5Cq/p54nr+tvKVkFfz8ovQePg lQDT/0utuOcqz7e1RjLkqeLXvIc/S+qEUOkEnGzsW3V89H5HMKaTFZ57rv9Rb+meKj3g +RQ6rebX3uQXOBghLTKxxYmuD9MmbcH1+LN+Or6EBX7JCAuA5cTIFSEJHWVlNY9CWWFF cmv0QEBWII0MzZmgFIbs3sw7d0+BeCtkc11MVXfS/kOu1q/l9v9lfMof5vRB2dmns9/b Lqg84iZOHScP6sZ8w5G21ODTzeCKDdswKsJbf4/owjM+/ZqE463PvFNS/rDqE5FeSf4g pJng== 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=G0r/zbgYPnEyflyD7XccyjW+MtrIqPXED0JW8pPaR1k=; b=osx6oOV5VxyDrbCCplIPCUiH4XWXELZDdeUIsfSSKbUcMoy2Gjf6pz69zjJm7DeKSM Sp4tv6xf7eQznqJ4MlYhA3sqqzkOBawf485qRzpDfrJsmoYdWW0efLARLlP7Ovn4mY1r fSLVQVuBINBkL00V3o1yXwzB0JpK3roPzx3g0pUyPtUgQpwAgyaXCxAXxHhj010SIHAS OTHi/nzK5L1VyrtUjaHdzM4ONkdy9Ikit0VbkM4E2CP5DTXCUsMl1inKTOGofzySNjs1 g5eMBQ4EAcILRvqE8YSyFMeLgNPl2heTcYRz2cLFotLKvjkoLYPwao2BsmBUgfpltEQd K/2Q== X-Gm-Message-State: AGi0PuZyLDVWQMIPWXMpiwtuIkIHA4l3PINy7UM8WDnOhICF1a2f2QFu nBvkVEMc+sfkZR1f4N3G+tMVB+4WXqtW6sjJDMRIZnPGWDxePNbznHO2xQrHzkADvHmQMBsnu0f pSzAvuoHUhRfkdaffDgPDgfSlTQbwRDS8KtZfzUhE/ICLX4oj+EmaHN1IHCvhN8Sv3rhrjF91TN mojwkAfo1q/FtB/OWmS5vnpYOx1TP/yA== X-Google-Smtp-Source: APiQypIY+SwHW46IVihJ8kq2FH34mwe0QeaJUEwHu/0egiLFYll5WCj2aohMphQP6MJc3tB1q4HEdg== X-Received: by 2002:a2e:5048:: with SMTP id v8mr4184558ljd.99.1586342073524; Wed, 08 Apr 2020 03:34:33 -0700 (PDT) Received: from localhost.localdomain ([157.33.140.123]) by smtp.gmail.com with ESMTPSA id e17sm13047610ljo.75.2020.04.08.03.34.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Apr 2020 03:34:32 -0700 (PDT) Subject: Re: [Proposal] Global temporary tables To: =?UTF-8?B?5pu+5paH5peM?= , Pavel Stehule , Robert Haas , Prabhat Sahu Cc: 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> <0498c45c-53cb-d9b0-c1e2-7d2d1a618511@postgrespro.ru> <20200109164829.mdl3z5xalmaqxs67@development> <3fef844f-0e73-8fcb-e4b6-595d6317b191@postgrespro.ru> <20200112015109.caab6qdr2ob6d5jv@development> <9262B679-EA73-495E-82A6-508F5625023F@alibaba-inc.com> <8517A6EA-17A6-4160-8987-B01073A0ECAF@alibaba-inc.com> <8BC7841E-3B32-4518-9586-D9ED571F4922@alibaba-inc.com> From: tushar Message-ID: <3aabfdf7-aa21-7658-d535-72a65948277f@enterprisedb.com> Date: Wed, 8 Apr 2020 16:04:20 +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: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit 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 On 4/7/20 2:27 PM, 曾文旌 wrote: > Vacuum full GTT, cluster GTT is already > supported in global_temporary_table_v24-pg13.patch. Please refer this below scenario , where pg_upgrade is failing 1)Server is up and running (./pg_ctl -D data status) 2)Stop the server ( ./pg_ctl -D data stop) 3)Connect to server using single user mode ( ./postgres --single -D data postgres) and create a global temp table [tushar@localhost bin]$ ./postgres --single -D data1233 postgres PostgreSQL stand-alone backend 13devel backend> create global temp table t(n int); --Press Ctl+D to exit 4)Perform initdb ( ./initdb -D data123) 5.Run pg_upgrade [tushar@localhost bin]$ ./pg_upgrade -d data -D data123 -b . -B . -- -- -- Restoring database schemas in the new cluster   postgres *failure* Consult the last few lines of "pg_upgrade_dump_13592.log" for the probable cause of the failure. Failure, exiting log file content  - [tushar@localhost bin]$ tail -20   pg_upgrade_dump_13592.log pg_restore: error: could not execute query: ERROR:  pg_type array OID value not set when in binary upgrade mode Command was: -- For binary upgrade, must preserve pg_type oid SELECT pg_catalog.binary_upgrade_set_next_pg_type_oid('13594'::pg_catalog.oid); -- For binary upgrade, must preserve pg_class oids SELECT pg_catalog.binary_upgrade_set_next_heap_pg_class_oid('13593'::pg_catalog.oid); CREATE GLOBAL TEMPORARY TABLE "public"."t" (     "n" integer ) WITH ("on_commit_delete_rows"='false'); -- For binary upgrade, set heap's relfrozenxid and relminmxid UPDATE pg_catalog.pg_class SET relfrozenxid = '0', relminmxid = '0' WHERE oid = '"public"."t"'::pg_catalog.regclass; -- regards,tushar EnterpriseDB https://www.enterprisedb.com/ The Enterprise PostgreSQL Company