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 1lZK9O-0002EK-UY for pgsql-bugs@arkaria.postgresql.org; Wed, 21 Apr 2021 21:12:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lZK9N-0000IN-OS for pgsql-bugs@arkaria.postgresql.org; Wed, 21 Apr 2021 21:12:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lZK9N-0000IG-Ib for pgsql-bugs@lists.postgresql.org; Wed, 21 Apr 2021 21:12:45 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lZK9L-0002Q4-KN for pgsql-bugs@lists.postgresql.org; Wed, 21 Apr 2021 21:12:45 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id E985B5C0097; Wed, 21 Apr 2021 17:12:41 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 21 Apr 2021 17:12:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=s1nFBpy8NgcMXNzXc0sAB8nax8g pzA6jDpxHApf+8zI=; b=KMzpX2X4Y6fNcv4I6xWnC9I9uSMzaZRL82rIwvH1y12 uLtuvJCS4k5w3PcL8Ll5Pz0lXIATwAbxEFEYUuBdJHa6OD3NYGRqC94OCJ6Mgu1f adTe2vVoxtCKZe+tBgmwHkIJQm9lUd2rjkMLJzFeiF8BX2s00L2QHqrKp5eXL15o qm7wK7SzrZwpzeFo1b943RP3ocCTVBsvW7wzQrqDoBHVpmUHhnsbNLFkvLT8ASjU 10yUe5pUwj6gXkaoFXvB3inlDovvdLb0NfEK1PFvI4C0XoT+9sNFzTrJsJOKzSzH K6L7OTxwu9kBcfNbd08MMv4d5omFEDdHBZ3xVRvjSkw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=s1nFBp y8NgcMXNzXc0sAB8nax8gpzA6jDpxHApf+8zI=; b=Ff8ly9RZE/ItkyQbTE7j5C Nxc+bODkC9zswcBf9qNiuk0q3/JO8QCGEFZiKwnl0rWLUghwj0Y/btRH7itPBFsO K3EGjPwsszw4Fg8sdbBzK+1fcMPxEx+8FcU8jpxDGZP69vJ7vAyNjG0ueHW7E8qh HrrL7J5KH2otmCnoYgmnJN33Q+mKZou8A66v3s30xmx3bOwGNZllo6d64Nkg7p3A h+7+NyOqukq/zkLpu+RPxHZ+DCiKeJUCDAeuRA5U00By/7DMg0tvmL38CA0Wkdlc 2qfRVwRdXY1bAHssIqMuwojgzphH+Vw6Ve17SlzB0uT9sQY2N/XjwAk5lLaXVMqQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddtkedgudeitdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughr vghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrf grthhtvghrnhepudekhfekleeugeevteehleffffejgeelueduleeffeeutdelffeujeff hfeuffdunecukfhppedutdejrddugedvrdeffedruddtfeenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvshesrghnrghrrgiivghl rdguvg X-ME-Proxy: Received: from intern.anarazel.de (107-142-33-103.lightspeed.sntcca.sbcglobal.net [107.142.33.103]) by mail.messagingengine.com (Postfix) with ESMTPA id 540C91080057; Wed, 21 Apr 2021 17:12:40 -0400 (EDT) Date: Wed, 21 Apr 2021 14:12:39 -0700 From: Andres Freund To: Tom Lane Cc: Amit Langote , David Steele , Pavel Biryukov <79166341370@yandex.ru>, PostgreSQL mailing lists Subject: Re: posgres 12 bug (partitioned table) Message-ID: <20210421211239.o7j5cz4wjvlhwcam@alap3.anarazel.de> References: <20200812162718.ycxrktzoe6rpdy5k@alap3.anarazel.de> <407111603806900@mail.yandex.ru> <793243.1619032209@sss.pgh.pa.us> <20210421195904.kaa74iovl6okscjg@alap3.anarazel.de> <801096.1619038302@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <801096.1619038302@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2021-04-21 16:51:42 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2021-04-21 15:10:09 -0400, Tom Lane wrote: > >> 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). > > > And ctid, I assume? While I have some hope for generalizing the > > representation of tids at some point, I don't think it's realistic that > > we'd actually get rid of them anytime soon. > > Hmm, I'd have thought that ctid would be very high on the list of > things we don't want to assume are the same for all AMs. Admittedly, > refactoring that is going to be a large pain in the rear, but ... I don't really see us getting rid of something like ctid as a generic concept across AMs - there's just too many places that need a way to reference a specific tuple. However, I think we ought to change how much code outside of AMs know about what tids mean. And, although that's a significant lift on its own, we ought to make at least the generic representation variable width. > I see that it actually works right now because slot_getsysattr > special-cases both tableoid and ctid, but I have a hard time > believing that that's a long-term answer. Not fully responsive to this: I've previously wondered if we ought to handle tableoid at parse-analysis or expression simplification time instead of runtime. It's not really something that needs runtime evaluation. But it's also not clear it's worth changing anything... > > One could even imagine partition root specific system columns... > > Yeah. As I think about this, I recall a previous discussion where > we suggested that maybe partitioned tables could have a subset > of system columns, whereupon all their children would be required > to support (at least) those system columns. But that would have > to be user-controllable, so a lot of infrastructure would need to > be built for it. For the moment I'd be satisfied with a fixed > decision that only tableoid is treated that way. I don't really see a convincing usecase to add this kind of complication with the current set of columns. Outside of tableoid and ctid every use of system attributes was either wrong, or purely for debugging / introspection, where restricting it to actual tables doesn't seem like a problem. Greetings, Andres Freund