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 1mG21l-00015d-AY for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Aug 2021 16:33:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mG21j-0001xy-FF for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Aug 2021 16:33:23 +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 1mG21j-0001ut-6X for pgsql-hackers@lists.postgresql.org; Tue, 17 Aug 2021 16:33:23 +0000 Received: from tamriel.snowman.net ([2001:470:e38f::11]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mG21g-0006Np-5Z for pgsql-hackers@postgresql.org; Tue, 17 Aug 2021 16:33:22 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 3B66B5F7A2; Tue, 17 Aug 2021 12:33:17 -0400 (EDT) Date: Tue, 17 Aug 2021 12:33:17 -0400 From: Stephen Frost To: Tom Lane Cc: Robert Haas , 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: <20210817163317.GQ17906@tamriel.snowman.net> References: <20210527172611.GP20766@tamriel.snowman.net> <20210527184352.zgsbq33hkiy5gxml@alap3.anarazel.de> <20210527192221.GQ20766@tamriel.snowman.net> <20210527195039.nzl77adigb5k3aim@alap3.anarazel.de> <20210527200913.GR20766@tamriel.snowman.net> <20210527210023.GJ5646@momjian.us> <20210527210942.GT20766@tamriel.snowman.net> <1228555.1629216774@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="NhX0wRdIbCNyp82h" Content-Disposition: inline In-Reply-To: <1228555.1629216774@sss.pgh.pa.us> 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 --NhX0wRdIbCNyp82h Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Tom Lane (tgl@sss.pgh.pa.us) wrote: > Robert Haas writes: > > To me, adding a separate TOC entry for a thing that is not really a > > separate object seems like a scary hack that might come back to bite > > us. Unfortunately, I don't know enough about pg_dump to say exactly > > how it might come back to bite us, which leaves wide open the > > possibility that I am completely wrong.... I just think it's the > > intention that archive entries correspond to actual objects in the > > database, not commands that we want executed in some particular order. >=20 > I agree, this seems like a moderately bad idea. It could get broken > either by executing only one of the TOC entries during restore, or > by executing them in the wrong order. The latter possibility could > be forestalled by adding a dependency, which I do not see this hunk > doing, which is clearly a bug. The former possibility would require > user intervention, so maybe it's in the category of "if you break > this you get to keep both pieces". Still, it's ugly. Yeah, agreed. > > If that criticism is indeed correct, then my proposal would be to > > instead add a WITH OID =3D nnn option to CREATE DATABASE and allow it to > > be used only in binary upgrade mode. >=20 > If it's not too complicated to implement, that seems like an OK idea > from here. I don't have any great love for the way we handle OID > preservation in binary upgrade mode, so not doing it exactly the same > way for databases doesn't seem like a disadvantage. Also agreed on this, though I wonder- do we actually need to explicitly make CREATE DATABASE q WITH OID =3D 1234; only work during binary upgrade mode in the backend? That strikes me as perhaps doing more work than we really need to while also preventing something that users might actually like to do. Either way, we'll need to check that the OID given to us can be used for the database, I'd think. Having pg_dump only include it in binary upgrade mode is fine though. Thanks, Stephen --NhX0wRdIbCNyp82h Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJhG+TMAAoJEO1sijiDR2RVdE4QAMTv//6quxq64D41dip1N4MQ 9P9t6J91PUZxQ8hdT5g01HGH4DDBH8qQ6LEXuCNxYRTS+tVJxhN2L8A+ViLmL4A/ /r542e1f8vrEpe6W36qX+JSbFekdgELO2fj3c8lZSvSbbUvWW2NapS2twUUxD0Mw G26rOoMaUEfabD7diQCKCOJ1rZCjVmcWxjMfUEhLK3r7igBTXmW0fTpMLkScVpsN et8S/hekh5N8nutzVomFkSj4pNyPn4l88FMiXxmogrtVvobjtNstOjACWw9emvz+ bW1z2MyLHDKhcJHIQLOmY5g3UUwAkX6/ravRaIxUeHMpwtcneFoFFp7heboR4fD3 66Qu2/2q6wY7huNKL7lp5sAUTsRC64Z7Kovfx08a0kAJ7YKTFUbqcms73Btd5+FT 33/xQypNav9cxvi4xsCY5yLQaZA9YgynbmwjoblnuepXAxQ51Ecj9/IKFbIZH00t ZJdefajwVd41XYjNmrkMb/Z6o8e+Yu78IPXvbMMJKnzOH4bmM+uEVRPhw6GCAYHO c6B7VN8sKWe0W0h0YVsSEpT7PhRBG2GLKfIf9IYlOKmtg5eO7DZBNtsubV/CArDX msoRdJ6w9VCO0VzSMpHIff0PEM3t1rztz8yGuD1l3cPaN54PBIJW0Ymo4hYht3sT Psub+Y07aa1V3hOf0gWj =vdrO -----END PGP SIGNATURE----- --NhX0wRdIbCNyp82h--