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 1k5i3q-0003SM-Ey for pgsql-bugs@arkaria.postgresql.org; Wed, 12 Aug 2020 04:08:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k5i3p-000555-Df for pgsql-bugs@arkaria.postgresql.org; Wed, 12 Aug 2020 04:08:21 +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 1k5i3p-00054y-7V for pgsql-bugs@lists.postgresql.org; Wed, 12 Aug 2020 04:08:21 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k5i3i-0006HH-SU for pgsql-bugs@lists.postgresql.org; Wed, 12 Aug 2020 04:08:20 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 07C48As9081886; Wed, 12 Aug 2020 00:08:10 -0400 From: Tom Lane To: Amit Langote cc: Andres Freund , Pavel Biryukov <79166341370@yandex.ru>, PostgreSQL mailing lists Subject: Re: posgres 12 bug (partitioned table) In-reply-to: References: <141051591267657@mail.yandex.ru> <1251598.1591289850@sss.pgh.pa.us> <20200811180231.fcssvhelqpnydnx7@alap3.anarazel.de> Comments: In-reply-to Amit Langote message dated "Wed, 12 Aug 2020 12:51:35 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <81884.1597205290.1@sss.pgh.pa.us> Date: Wed, 12 Aug 2020 00:08:10 -0400 Message-ID: <81885.1597205290@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Amit Langote writes: > On Wed, Aug 12, 2020 at 3:02 AM Andres Freund wrote: >> Medium term I think we should just plain out forbid references to system >> columns in partioned tables Or at least insist that all partitions have >> that column. > Performance-wise I would prefer the former, because the latter would > involve checking *all* partitions statically in the INSERT case, > something that we've avoided doing so far. It's not like we don't have a technology for doing that. The way this ideally would work, IMV, is that the parent partitioned table either has or doesn't have a given system column. If it does, then every child must too, just like the way things work for user columns. This'd require (a) some sort of consensus about which kinds of system columns can make sense --- as Andres noted, 32-bit xmin might not be the best choice here --- and (b) some notation for users to declare which of these columns they want in a partitioned table. Once upon a time we had WITH OIDS, maybe that idea could be extended. I'm not entirely sure that this is worth all the trouble, but that's how I'd sketch doing it. regards, tom lane