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 1gbay9-0003Mg-7N for pgsql-bugs@arkaria.postgresql.org; Tue, 25 Dec 2018 00:53:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gbay7-0006L2-NJ for pgsql-bugs@arkaria.postgresql.org; Tue, 25 Dec 2018 00:53:11 +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 1gbay7-0006Kv-Di for pgsql-bugs@lists.postgresql.org; Tue, 25 Dec 2018 00:53:11 +0000 Received: from tama50.ecl.ntt.co.jp ([129.60.39.147]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gbay2-0004fc-6f for pgsql-bugs@lists.postgresql.org; Tue, 25 Dec 2018 00:53:10 +0000 Received: from vc1.ecl.ntt.co.jp (vc1.ecl.ntt.co.jp [129.60.86.153]) by tama50.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id wBP0r4c0020569; Tue, 25 Dec 2018 09:53:04 +0900 Received: from vc1.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id B53B6EA74CC; Tue, 25 Dec 2018 09:53:04 +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 A72EBEA69C0; Tue, 25 Dec 2018 09:53:04 +0900 (JST) Received: from [127.0.0.1] (unknown [129.60.241.61]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTPSA id 9247040085C; Tue, 25 Dec 2018 09:53:04 +0900 (JST) Subject: Re: BUG #15565: truncate bug with tables which have temp table inherited References: <15565-ce67a48d0244436a@postgresql.org> <20181225004545.GB2334@paquier.xyz> From: Amit Langote Message-ID: Date: Tue, 25 Dec 2018 09:52:55 +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: <20181225004545.GB2334@paquier.xyz> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CC-Mail-RelayStamp: 1 To: Michael Paquier , digoal@126.com, pgsql-bugs@lists.postgresql.org X-TM-AS-MML: disable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2018/12/25 9:45, Michael Paquier wrote: > On Mon, Dec 24, 2018 at 09:17:46AM +0000, PG Bug reporting form wrote: >> create table public.a (id int); >> create temp table a (like public.a) inherits(public.a); > > This issue is way older than 11. > > A couple of months ago there has been a discussion about mixing > temporary and permanent tables in a partition tree: > https://www.postgresql.org/message-id/CAKJS1f94Ojk0og9GMkRHGt8wHTW=ijq5KzJKuoBoqWLwSVwGmw@mail.gmail.com > > The conclusion of this time was that we don't want to allow mixing > relations with different persistencies in the same tree for > partitions because those rely on relation cache lookups for their > description (PartitionDesc), however inheritance trees have been able > to accidently work this way for a long time. This shares a little bit > of history with this report as partition trees and inheritance share > the same lookups at pg_inherits. > > So there could be an argument to restrict the definition of > inheritance trees with trees mixing relation persistencies. > > It is hard to say as well that truncate silently bypasses the > truncation of a temporary relation from another session if a given > session wants to truncate a whole tree. Hmm, why don't we just ignore them like queries do? Thanks, Amit