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 1mJISE-00027s-At for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Aug 2021 16:42:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mJISD-00080K-86 for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Aug 2021 16:42:13 +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 1mJISD-00080C-0A for pgsql-hackers@lists.postgresql.org; Thu, 26 Aug 2021 16:42:13 +0000 Received: from tamriel.snowman.net ([70.109.60.50]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mJIS7-0002zj-Ua for pgsql-hackers@postgresql.org; Thu, 26 Aug 2021 16:42:11 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 8EE145F799; Thu, 26 Aug 2021 12:42:07 -0400 (EDT) Date: Thu, 26 Aug 2021 12:42:07 -0400 From: Stephen Frost To: Robert Haas Cc: Tom Lane , Shruthi Gowda , 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) Message-ID: <20210826164207.GE17906@tamriel.snowman.net> References: <1228555.1629216774@sss.pgh.pa.us> <20210817163317.GQ17906@tamriel.snowman.net> <1230173.1629218575@sss.pgh.pa.us> <1366142.1629222880@sss.pgh.pa.us> <20210826153952.GC17906@tamriel.snowman.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="O0RfEaj5QEwx6Xhb" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --O0RfEaj5QEwx6Xhb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Robert Haas (robertmhaas@gmail.com) wrote: > On Thu, Aug 26, 2021 at 11:39 AM Stephen Frost wrote: > > This looks like a pretty good analysis to me. As it relates to the > > question about allowing users to specify an OID, I'd be inclined to > > allow it but only for OIDs >64k. We've certainly reserved things in the > > past and I don't see any issue with having that reservation here, but if > > we're going to build the capability to specify the OID into CREATE > > DATABASE then it seems a bit odd to disallow users from using it, as > > long as we're preventing them from causing problems with it. > > > > Are there issues that you see with allowing users to specify the OID > > even with the >64k restriction..? I can't think of one offhand but > > perhaps I'm missing something. >=20 > So I actually should have said 16k here, not 64k, as somebody already > pointed out to me off-list. Whee! Hah, yes, of course. > I don't know of a reason not to let people do that, other than that it > seems like an attractive nuisance. People will do it and it will fail > because they chose a duplicate OID, or they'll complain that a regular > dump and restore didn't preserve their database OIDs, or maybe they'll > expect that they can copy a database from one cluster to another > because they gave it the same OID! That said, I don't see a great harm > in it. It just seems to me like exposing knobs to users that don't > seem to have any legitimate use may be borrowing trouble. We're going to have to gate this somehow to allow the OIDs under 16k to be used, so it seems like what you're suggesting is that we have that gate in place but then allow any OID to be used if you've crossed that gate? That is, if we do something like: SELECT pg_catalog.binary_upgrade_allow_setting_db_oid(); CREATE DATABASE blah WITH OID 1234; for pg_upgrade, well, users who are interested may well figure out how to do that themselves if they decide they want to set the OID, whereas if it 'just works' provided they don't try to use an OID too low then maybe they won't try to bypass the restriction against using system OIDs..? Ok, I'll give you that this is a stretch and I'm on the fence about if it's worthwhile or not to include and document and if, as you say, it's inviting trouble to allow users to set it. Users do seem to have a knack for finding things even when they aren't documented and then we get to deal with those complaints too. :) Perhaps others have some stronger feelings one way or another. Thanks, Stephen --O0RfEaj5QEwx6Xhb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJhJ8RfAAoJEO1sijiDR2RVQswP/A6ewPdq5bnqqZZMow6eFVwX YQxGVnO8JzdhvvVXAbR7i9FCYhRuKAEb+GUuctEriUA3EdNRelhNr4nP1FnOOw2g wt9pBL7LKD9L4TmpUtF5FTNWtVkDHstz36dp8UMtur8bGE4NBEkx+9Qx/Vwo64PR roONVTYTe1QTAc71UlykunMbxVhpTRH7GY4SV757L34MMOzYBjUvDtSmt8iqSjM1 SSMfP9Pqtp8gsW8rp+McHk5M5cAItxmxD4VmowdANn1BGyBPi5BPgnll5p7dDtwC flGD7/w42sfYILLaDaMcfInopX8iTI0dxjtvTbqayVfx+hFbRQwRqW3BusLgK5JF gWxgtmIpzXzzG7ySp4IK0ds8OuEJRmDWLweFrsDl0l0+tY+cBlNHqgYbiHu8HmPO zCEoYnb9HV87XcceSF95mtcZ0T1x9XIPMW8GbSo/0SsljM4Ff5naRqk9XSk1cmyc WQvRFFwyAjJZ/X6i38v98+2Vhh7gpOIfkcG2o6edPHTi4Yk6YQBgGbMdAy+BXKTr ws/66bx/LdUsOoytrHu4zmffLyeKe49JUUju/ZdZAnvuyRC7Kor688UYWSofXb4h 57wp3f3N9Jsdh+d1tq3qBu/OQesGoNI7WyJ/xLnyk7m9fiDe/NbkittjF1K+ubFY AgqrL+vKWmf1koy2FjsH =d8qr -----END PGP SIGNATURE----- --O0RfEaj5QEwx6Xhb--