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.94.2) (envelope-from ) id 1uu24k-000ume-Jc for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Sep 2025 04:59:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uu24j-00DA4e-QH for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Sep 2025 04:59:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uu24i-00DA4W-U3 for pgsql-hackers@lists.postgresql.org; Thu, 04 Sep 2025 04:59:57 +0000 Received: from fout-b7-smtp.messagingengine.com ([202.12.124.150]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uu24e-000TQs-23 for pgsql-hackers@lists.postgresql.org; Thu, 04 Sep 2025 04:59:56 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfout.stl.internal (Postfix) with ESMTP id 009641D00351; Thu, 4 Sep 2025 00:59:50 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Thu, 04 Sep 2025 00:59:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; 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=fm1; t=1756961990; x=1757048390; bh=3v6mg3acIg iZeGvk0EigeeG8LeQvt9LuP8hG3HoNg6M=; b=rXMPiaDPMpwXdDH6zaNGnn3TUG m1eRtIek9oV8/3ePaPnMmLan480FDhcdpeVzgipHSsNz1XtIeZRUpwYWkkMcj1Cd JlEg4U810Ht73qPzhOxVxCOImJKnDZ4oczkS541JglI4G4ne/gzcRnlj9/nlhWRl AAzAstkKgqfShXLKTajXWFHbWo0MtyvasOrdRNpn4gV92JyiTuztLjn/rNbaWqwF cjQKSuE5zXfSu0H7akwzaEvOgiRPJ9tjqcULmm0haWXCzfrBf3WkLaEC9YM/x7n4 NwlxJxlwRB83gRXGHkN0etwcMTeHtwhfxoNzk4OTQtpVak2SslF2QwSblhzQ== 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=fm1; t= 1756961990; x=1757048390; bh=3v6mg3acIgiZeGvk0EigeeG8LeQvt9LuP8h G3HoNg6M=; b=apjP7klmpy+YESWjceMVBoH6kAajynmw3E+tKLq3JgOZbqm5Hc3 C71cf/QL35lCy++zYlTQdFkmSuU6s9EzvelWYllu2Az0IKT3v3hq2mhQzrGqVh5c VML0Z42mBJf640aqiO8ZPQazR+giSVWed3X2ldzytTxDJZRqg3+3rxTbvgxwqO5A eSDRmUbu/cOEcLc5CYBiGG0iSYEfYO47UxtYTUSfi66Rt4CKCY+IPnMaZNl7lBGE TTEApyg9+fVEg5qoYCDV7625xXrxWtSbQuzBGfodlvmxb0c8gY5R9vOdzcjHXCYl SuL9Iw3nnvir5WOqhQ+zqJUyIPAgovSnLtg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdehudefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrhhluc fvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddvnecu hfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqhhuih gvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeggeegfffh keeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidpnhgs pghrtghpthhtohephedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepnhgrthhhrg hnuggsohhsshgrrhhtsehgmhgrihhlrdgtohhmpdhrtghpthhtohepthhglhesshhsshdr phhghhdrphgrrdhushdprhgtphhtthhopehnihhtihhnmhhothhirghnihesghhoohhglh gvrdgtohhmpdhrtghpthhtohephhgrnhhnuhhksehgohhoghhlvgdrtghomhdprhgtphht thhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdroh hrgh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 4 Sep 2025 00:59:48 -0400 (EDT) Date: Thu, 4 Sep 2025 13:59:36 +0900 From: Michael Paquier To: Nathan Bossart Cc: Tom Lane , Nitin Motiani , Hannu Krosing , PostgreSQL Hackers Subject: Re: pg_upgrade: transfer pg_largeobject_metadata's files when possible Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="HghOGTkopIgjDG0O" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --HghOGTkopIgjDG0O Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 02, 2025 at 09:43:40AM -0500, Nathan Bossart wrote: > Do you think a new pg_upgrade test for security labels is worth the > trouble? It seems doable, but it'd be an awfully expensive test for this. > On the other hand, I'm not sure there's any coverage for pg_upgrade with > security labels, so perhaps this is a good time to establish some tests. I would argue in favor of these additions. Security labels are not the most popular thing ever, AFAIK, but your patch makes the need more relevant to have. The cheapest approach would be to add a LO creation pattern in src/bin/pg_dump/t/002_pg_dump.pl, with an EXTRA_INSTALL pointing at src/test/modules/dummy_seclabel/ to be able to create the security label (we already do that in pg_upgrade and pg_basebackup so the trick works). That should be enough to make sure that the binary upgrade dumps have the seclabel data included. It's a bit funky, I agree. So if you think that this is not worth the test cycles, I won't push hard on this point, either. > No, that stuff is discarded for upgrades from those versions. My intent > was to maintain readability by avoiding lots of version checks. FWIW I > originally put all of the pg_large_object_metadata stuff in a separate > block, but that resulted in a lot of copy/pasted code. I'm happy to adju= st > it as you see fit. + if (fout->remoteVersion >=3D 160000) + ArchiveEntry(fout, nilCatalogId, createDumpId(), + ARCHIVE_OPTS(.tag =3D "pg_largeobject_metadata", + .description =3D "pg_largeobject_met= adata", + .section =3D SECTION_PRE_DATA, + .createStmt =3D lomOutQry->data)); So it's filtered out depending on the old cluster version here. I have managed to miss this part. Some tests with LOs and across multiple backend versions (pg_dump -C --binary-upgrade) are showing me that I am wrong and that you are right, with diffs showing up properly in the binary upgrade dumps for pg_largeobject_metadata. This logic looks OK to me, even if it's a waste to fill lomOutQry when upgrading =66rom an instance in the 9.3~15 range, discarding ArchiveEntry() at the end. It's not a big deal. -- Michael --HghOGTkopIgjDG0O Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmi5HLgACgkQnvQgOdby QH173xAAqrxfhgXRVVKBcVQ7MFZJT0eGy3W7pBBQ0LSgaEEsO2GC7VqPTP+BVS9B lYtukLIa1c53WsTHI+u7SnwtMeSqHgjGxLrF3nl/fEAIARBfR0jsxLqrMVWMCHI1 xtIYMh7bgscvYc1V86r21CMD0ncSopuTw/IQimoqDIEqZGLN1RCqkNQdxNy3+nOv XfELv8yeGKY5Cj9BZkFIZRDkXf6wKi6GwDo4HXOV7u5GNRU3N0147h4IM9ZUF7i0 IDg6X3JykCcXdZqTYcA/TfeNzIJaA4QSfdV3rFCSYWCNSxTgk41725wlOcuuNpM6 JBoDGBunTe5px+Nn7r7TOEr4+KA9mjWYYka++LNfvAUwcHOa6ya7ilqV7WmqeVWm Dww+kkt86Hpy1KntdDDdShIbmAZu8WqyBuBka2NOypSl83Y5+yCEDrxnlY8eqc0q pvXszEYkhXLgRythUYpsPKxRyfnA4kypV3LP2n+SYB4HyradWy144S9EhPb1sQJr 3scjOMNRHv3N62biv6KN5Swi4SuU6nUCBTOaAiLgycmnktXea5sDGsKHb+haU/G6 WTAA9bGT7Ja0SWbboacdXBovsoqiva16O9miPPzca1hoT3HXLIpI0jI1fgsxu7uZ rcnihNg4v4Og46McjYSVZl0+u7c/RQPXxsZHGB8HnLSMS8j0cS8= =Lmvo -----END PGP SIGNATURE----- --HghOGTkopIgjDG0O--