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 1nAz6G-0006Mw-Qk for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Jan 2022 18:57:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nAz6F-0000Jg-Ml for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Jan 2022 18:57:27 +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 1nAz6F-0000JX-DL for pgsql-hackers@lists.postgresql.org; Fri, 21 Jan 2022 18:57:27 +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 1nAz6D-00043l-Fq for pgsql-hackers@postgresql.org; Fri, 21 Jan 2022 18:57:27 +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 20LIvIWT1203380; Fri, 21 Jan 2022 13:57:18 -0500 From: Tom Lane To: Robert Haas cc: Shruthi Gowda , Julien Rouhaud , Sadhuprasad Patro , Stephen Frost , Bruce Momjian , Andres Freund , Alvaro Herrera , Masahiko Sawada , Tom Kincaid , Amit Kapila , Thomas Munro , PostgreSQL Development , Masahiko Sawada Subject: Re: preserving db/ts/relfilenode OIDs across pg_upgrade (was Re: storing an explicit nonce) In-reply-to: References: <20220115054719.yeqoy2mdllbc7wq2@jrouhaud> Comments: In-reply-to Robert Haas message dated "Fri, 21 Jan 2022 13:47:26 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1203378.1642791438.1@sss.pgh.pa.us> Date: Fri, 21 Jan 2022 13:57:18 -0500 Message-ID: <1203379.1642791438@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Robert Haas writes: > It seems to me that what this comment is saying is that OIDs in the > second and third categories are doled out by counters. Therefore, we > can't know which of those OIDs will get used, or how many of them will > get used, or which objects will get which OIDs. Therefore, I think we > should go back to the approach that you were using for template0 and > handle both that database and postgres using that method. That is, > assign an OID manually, and make sure unused_oids knows that it should > be counted as already used. Indeed. If you're going to manually assign OIDs to these databases, do it honestly, and put them into the range intended for that purpose. Trying to take short-cuts is just going to cause trouble down the road. regards, tom lane