Re: Horribly slow pg_upgrade performance with many Large Objects - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Horribly slow pg_upgrade performance with many Large Objects
Date
Msg-id 4050387.1744132029@sss.pgh.pa.us
Whole thread Raw
In response to Re: Horribly slow pg_upgrade performance with many Large Objects  (Nathan Bossart <nathandbossart@gmail.com>)
Responses Re: Horribly slow pg_upgrade performance with many Large Objects
Re: Horribly slow pg_upgrade performance with many Large Objects
List pgsql-hackers
Nathan Bossart <nathandbossart@gmail.com> writes:
> I do think it's worth considering going back to copying
> pg_largobject_metadata's files for upgrades from v16 and newer.

(If we do this) I don't see why we'd need to stop at v16.  I'm
envisioning that we'd use COPY, which will be dealing in the
text representation of aclitems, and I don't think that's changed
in a long time.  The sort of thing that would break it is changes
in the set of available/default privilege bits for large objects.

That is, where the dump currently contains something like

SELECT pg_catalog.lo_create('2121');
ALTER LARGE OBJECT 2121 OWNER TO postgres;
GRANT ALL ON LARGE OBJECT 2121 TO joe;

we'd have

COPY pg_largeobject_metadata FROM STDIN;
...
2121    10    {postgres=rw/postgres,joe=rw/postgres}
...

and some appropriate COPY data for pg_shdepend too.

(The fact that this representation will contain both numeric and
symbolic role OIDs is why I was concerned about OID stability.)

The key thing that worries me here is if the source and target
versions have different ideas of which roles are pinned, which would
silently change what appears in pg_shdepend.  But it'd only really
break if a role mentioned in some LO's owner or ACL is pinned in the
source and not in the target, which seems unlikely.  (In the other
direction, we'd just be adding a useless row in pg_shdepend.)

            regards, tom lane



pgsql-hackers by date:

Previous
From: Jacob Champion
Date:
Subject: Re: [PoC] Federated Authn/z with OAUTHBEARER
Next
From: Wolfgang Walther
Date:
Subject: Re: [PoC] Federated Authn/z with OAUTHBEARER