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 1lZKYn-0003AT-54 for pgsql-bugs@arkaria.postgresql.org; Wed, 21 Apr 2021 21:39:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lZKYm-0004sS-2i for pgsql-bugs@arkaria.postgresql.org; Wed, 21 Apr 2021 21:39:00 +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 1lZKYl-0004sD-T0 for pgsql-bugs@lists.postgresql.org; Wed, 21 Apr 2021 21:38:59 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lZKYj-0002kD-Un for pgsql-bugs@lists.postgresql.org; Wed, 21 Apr 2021 21:38:59 +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 13LLcrHM804630; Wed, 21 Apr 2021 17:38:53 -0400 From: Tom Lane To: Andres Freund cc: Amit Langote , David Steele , Pavel Biryukov <79166341370@yandex.ru>, PostgreSQL mailing lists Subject: Re: posgres 12 bug (partitioned table) In-reply-to: <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> <20210421211239.o7j5cz4wjvlhwcam@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Wed, 21 Apr 2021 14:12:39 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <804628.1619041133.1@sss.pgh.pa.us> Date: Wed, 21 Apr 2021 17:38:53 -0400 Message-ID: <804629.1619041133@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > On 2021-04-21 16:51:42 -0400, Tom Lane wrote: >> 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. It seems like it might not be that hard to convert ctid generically into a uint64, where heaps and heap-related indexes only use 6 bytes of it. Variable-width I agree would be a very big complication added on top, and I'm not quite convinced that we need it. > 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... If you do "RETURNING tableoid" in DML on a partitioned table, or on a traditional-inheritance hierarchy, you get the OID of the particular partition that was touched (indeed, that's the whole point of the feature, IIRC). Don't really see how that could be implemented earlier than runtime. Also don't see where the win would be, TBH. regards, tom lane