Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wHjPW-007Sfe-1t for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Apr 2026 14:27:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wHjPV-0009VF-2T for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Apr 2026 14:27:37 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wHjPU-0009Uk-2T for pgsql-hackers@lists.postgresql.org; Tue, 28 Apr 2026 14:27:37 +0000 Received: from fhigh-a2-smtp.messagingengine.com ([103.168.172.153]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wHjPS-00000003CTf-0DF3 for pgsql-hackers@lists.postgresql.org; Tue, 28 Apr 2026 14:27:35 +0000 Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfhigh.phl.internal (Postfix) with ESMTP id BE3C51400022; Tue, 28 Apr 2026 10:27:32 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Tue, 28 Apr 2026 10:27:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1777386452; x=1777472852; bh=LUlz162soI VWX8L2jHi/IGwAk3sKxZo1L9VPPKb3PJw=; b=OR2RNxAGXfiejViTie3Qu2wgzX PDxiOSchOMh4652Wju6cJD6/7s+Tq+CprkogKokl2EhxZ71nHKzA1dU8BVWmq2SR W2i+Vs7TsH/GisdGuCFSQnWfzPVzq3vyT7KVC9YII7eAWR3/A+mKkVvC9CPUpOui S2fITLNVHEoMkQU1W+XhE4g1kBdnChySskZxXIGVKkioM/jG1wlGNc+3iz6qDxvF 3OsTBvavK/calUz0cPJI3XOfnUMqQp+zOOSdHyMM/8FqHLnMTuaRLKd9BN6SY28j NqpGEk6DTWQSoQiaq0SBs6vIN/yfI+r7kexYeSBMTfgzgFQbKfTBXdIjvSXw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1777386452; x=1777472852; bh=LUlz162soIVWX8L2jHi/IGwAk3sKxZo1L9V PPKb3PJw=; b=iPvnnY6pO4YRJb4aVzY+a7wVtZskPL0f4vMRlRoFWaGQIuGfdCB BxbIyWDpc9ZY1PB6W0YB+Ul+zGB2rBgH4csUZcvHGNIKwTsrih+ttpZ0lMdVEUvH /fc2KutcFkFiUFZkGpe/GeanAVvLoPzAspqPs7mlLzYTaeeEKlB50i5FAxM8wb2P Z5ny+B3HvFcABXuTEPpVWQxtPKZ4aImPxmAdQtpSJQms9njMuVmP213oc/L1Br8r sqY55qxTVkJRo4T5gfN0Jj1Y2LsdOu3SOhErbqznQma8jjhHmBry3oW9Lm88E7TS MfzWDre+FiFBAdQYLhX5PAlyyHbWwWHO6/w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdekudektdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecunecujfgurhepfffhvfevuffkfhggtggujgesthdtsfdttd dtvdenucfhrhhomheptehnughrvghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghr rgiivghlrdguvgeqnecuggftrfgrthhtvghrnhephfdthfefheeggfettedvfeeufeegvd fhgeelkeeifeettdevvddtueetffeiueeknecuffhomhgrihhnpehpohhsthhgrhgvshhq lhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpegrnhgurhgvshesrghnrghrrgiivghlrdguvgdpnhgspghrtghpthhtohepvddpmhho uggvpehsmhhtphhouhhtpdhrtghpthhtohepughgrhhofihlvgihmhhlsehgmhgrihhlrd gtohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrsheslhhishhtshdrphhoshht ghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 28 Apr 2026 10:27:32 -0400 (EDT) Date: Tue, 28 Apr 2026 10:27:32 -0400 From: Andres Freund To: David Rowley Cc: PostgreSQL Developers Subject: Re: Any reason to keep HEAP_HASOID_OLD? Message-ID: <4hvs4bhasxfwxvwelpodetdlhl2tjhqk3r4snknyktyzxlcx7e@jxzhlkjxt7s6> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2026-04-28 16:27:59 +1200, David Rowley wrote: > Andres mentioned to me that I might want to look at > HeapTupleHeaderGetOidOld() as there's a comment and some code there > that would lead you to believe we can still have tuples with oids. If > that were true, the code I recently added for getting 'tp' in > slot_selectively_deform_heap_tuple() is wrong. > > #define HEAP_HASOID_OLD 0x0008 /* has an object-id field */ > > On 11.22, I tried: > > create extension pageinspect; > create table t1 (a int) with oids; > insert into t1 select generate_Series(1,1000); > select count(*) from heap_page_items(get_raw_page('public.t1',0)) > where t_infomask & 8 <> 0; > > count > ------- > 185 > > alter table t1 set without oids; > > select count(*) from heap_page_items(get_raw_page('public.t1',0)) > where t_infomask & 8 <> 0; > count > ------- > 0 Yea, it seems we've started rewriting tables for SET WITHOUT OIDS a long time ago: /* * If we dropped the OID column, must adjust pg_class.relhasoids and tell * Phase 3 to physically get rid of the column. We formerly left the * column in place physically, but this caused subtle problems. See * http://archives.postgresql.org/pgsql-hackers/2009-02/msg00363.php */ if (attnum == ObjectIdAttributeNumber) I also verified that we don't allow SET WITHOUT OIDS when it's used as a row type in another table. > And also, if I try to pg_upgrade before SET WITHOUT OIDS, I get: > > $ pg_upgrade -d pgdata11 -D pgdata -b ~/pg11/bin -B ~/pg/bin > Performing Consistency Checks > ----------------------------- > Checking cluster versions ok > Checking database user is the install user ok > Checking database connection settings ok > Checking for prepared transactions ok > Checking for system-defined composite types in user tables ok > Checking for reg* data types in user tables ok > Checking for contrib/isn with bigint-passing mismatch ok > Checking for user-defined encoding conversions ok > Checking for user-defined postfix operators ok > Checking for incompatible polymorphic functions ok > Checking for tables WITH OIDS fatal > > So, I'm not following how we could get a tuple with OIDs in versions after 11. I don't see it either. Wonder why I / decided to leave it :/. > Should we get rid of HEAP_HASOID_OLD and the code that relates to it? Looks like it. Greetings, Andres Freund