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.89) (envelope-from ) id 1gbhh5-000739-WA for pgsql-bugs@arkaria.postgresql.org; Tue, 25 Dec 2018 08:04:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gbhh4-000594-Nf for pgsql-bugs@arkaria.postgresql.org; Tue, 25 Dec 2018 08:04:02 +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 1gbhh4-00058x-EH for pgsql-bugs@lists.postgresql.org; Tue, 25 Dec 2018 08:04:02 +0000 Received: from tama500.ecl.ntt.co.jp ([129.60.39.148]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gbhh0-0005ie-2S; Tue, 25 Dec 2018 08:04:01 +0000 Received: from vc1.ecl.ntt.co.jp (vc1.ecl.ntt.co.jp [129.60.86.153]) by tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id wBP83pUY001155; Tue, 25 Dec 2018 17:03:51 +0900 Received: from vc1.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 5316FEA7B29; Tue, 25 Dec 2018 17:03:51 +0900 (JST) Received: from jcms-pop21.ecl.ntt.co.jp (jcms-pop21.ecl.ntt.co.jp [129.60.87.134]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 4866FEA7A13; Tue, 25 Dec 2018 17:03:51 +0900 (JST) Received: from [127.0.0.1] (unknown [129.60.241.61]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTPSA id 43C30400B38; Tue, 25 Dec 2018 17:03:51 +0900 (JST) Subject: Re: BUG #15565: truncate bug with tables which have temp table inherited References: <15565-ce67a48d0244436a@postgresql.org> <0285c6d1-2d11-2f2c-6fae-d4575cdc3c7b@lab.ntt.co.jp> From: Amit Langote Message-ID: <496ce153-fb3b-c8b1-65bd-8a376a88dbc2@lab.ntt.co.jp> Date: Tue, 25 Dec 2018 17:03:37 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.3 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------EDCC41FF1EE9F6D5CA49CA8C" Content-Language: en-US X-CC-Mail-RelayStamp: 1 To: David Rowley Cc: digoal@126.com, pgsql-bugs@lists.postgresql.org, PG Bug reporting form X-TM-AS-MML: disable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------EDCC41FF1EE9F6D5CA49CA8C Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 2018/12/25 16:27, David Rowley wrote: > On Tue, 25 Dec 2018 at 13:50, Amit Langote > wrote: >> I'm not sure if the error being shown is a bug, but maybe we could remove >> the error by making truncate do the same thing as select/update/delete, >> that is, ignore child tables that are temporary of tables of other >> sessions. Attached patch to do that. > > I glanced at this and was confused at where "newrelation" comes from > and also the single parameter heap_close(). It does not look like it > would compile. Sorry, that was pretty negligent of me. Here's the updated patch. Thanks, Amit --------------EDCC41FF1EE9F6D5CA49CA8C Content-Type: text/plain; charset=UTF-8; name="truncate-ignore-other-session-temp-children-v2.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="truncate-ignore-other-session-temp-children-v2.patch" ZGlmZiAtLWdpdCBhL3NyYy9iYWNrZW5kL2NvbW1hbmRzL3RhYmxlY21kcy5jIGIvc3JjL2Jh Y2tlbmQvY29tbWFuZHMvdGFibGVjbWRzLmMKaW5kZXggNTg4YzFlYzUzNi4uYmFkNjk4YzEy NSAxMDA2NDQKLS0tIGEvc3JjL2JhY2tlbmQvY29tbWFuZHMvdGFibGVjbWRzLmMKKysrIGIv c3Jj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