Re: pg_upgrade: transfer pg_largeobject_metadata's files when possible - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: pg_upgrade: transfer pg_largeobject_metadata's files when possible
Date
Msg-id aYTVAFTPelebVl6W@nathan
Whole thread Raw
In response to Re: pg_upgrade: transfer pg_largeobject_metadata's files when possible  (Andres Freund <andres@anarazel.de>)
Responses Re: pg_upgrade: transfer pg_largeobject_metadata's files when possible
Re: pg_upgrade: transfer pg_largeobject_metadata's files when possible
List pgsql-hackers
On Thu, Feb 05, 2026 at 11:19:46AM -0500, Andres Freund wrote:
> It certainly seems better than what we do now.  Still feels pretty grotty and
> error prone to me that we fill the catalog table and then throw the contents
> out.

Before I go any further with this approach, I thought of something else we
could do that I believe is worth considering...

As of commit 3bcfcd815e, the only reason we are dumping any of
pg_largeobject_metadata at all is to avoid an ERROR during COMMENT ON or
SECURITY LABEL ON because the call to LargeObjectExists() in
get_object_address() returns false.  If we bypass that check in
binary-upgrade mode, we can skip dumping pg_largeobject_metadata entirely.

The attached patch passes our existing tests, and it seems to create the
expected binary-upgrade-mode dump files, too.  I haven't updated any of the
comments yet.

-- 
nathan

Attachment

pgsql-hackers by date:

Previous
From: Pavlo Golub
Date:
Subject: Re: Re[2]: [PATCH] Add last_executed timestamp to pg_stat_statements
Next
From: Nathan Bossart
Date:
Subject: Re: pg_upgrade: transfer pg_largeobject_metadata's files when possible