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 1lZIEv-000627-CN for pgsql-bugs@arkaria.postgresql.org; Wed, 21 Apr 2021 19:10:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lZIEt-0003Fd-OB for pgsql-bugs@arkaria.postgresql.org; Wed, 21 Apr 2021 19:10:19 +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 1lZIEt-0003FW-IJ for pgsql-bugs@lists.postgresql.org; Wed, 21 Apr 2021 19:10:19 +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 1lZIEn-0003lW-Os for pgsql-bugs@lists.postgresql.org; Wed, 21 Apr 2021 19:10:18 +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 13LJA9UN793244; Wed, 21 Apr 2021 15:10:09 -0400 From: Tom Lane To: Amit Langote cc: David Steele , Pavel Biryukov <79166341370@yandex.ru>, Andres Freund , 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> <81885.1597205290@sss.pgh.pa.us> <20200812162718.ycxrktzoe6rpdy5k@alap3.anarazel.de> <407111603806900@mail.yandex.ru> Comments: In-reply-to Amit Langote message dated "Fri, 12 Mar 2021 21:47:18 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <793242.1619032209.1@sss.pgh.pa.us> Date: Wed, 21 Apr 2021 15:10:09 -0400 Message-ID: <793243.1619032209@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Amit Langote writes: > Forgot to ask in the last reply: for HEAD, should we consider simply > preventing accessing system columns when querying through a parent > partitioned table, as was also mentioned upthread? Indeed, it seems like this thread is putting a fair amount of work into a goal that we shouldn't even be trying to do. We gave up the assumption that a partitioned table's children would have consistent system columns the moment we decided to allow foreign tables as partition leaf tables; and it's only going to get worse as alternate table AMs become more of a thing. So now I'm thinking the right thing to be working on is banning access to system columns via partition parent tables (other than tableoid, which ought to work). I'm not quite sure whether the right way to do that is just not make pg_attribute entries for system columns of partitioned tables, as we do for views; or make them but have a code-driven error if you try to use one in a query. The second way is uglier, but it should allow a more on-point error message. OTOH, if we start to have different sets of system columns for different table AMs, we can't have partitioned tables covering all of those sets. In the meantime, if the back branches fail with something like "virtual tuple table slot does not have system attributes" when trying to do this, that's not great but I'm not sure we should be putting effort into improving it. regards, tom lane