From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Replacing pg_depend PIN entries with a fixed range check
Date: Thu, 15 Apr 2021 19:59:24 -0400
Message-ID: <3965335.1618531164@sss.pgh.pa.us> (raw)
In-Reply-To: <20210415234812.ylpcg3skayca7axw@alap3.anarazel.de>
References: <3737988.1618451008@sss.pgh.pa.us>
<20210415234812.ylpcg3skayca7axw@alap3.anarazel.de>
Andres Freund <andres@anarazel.de> writes:
> Hm, maybe we ought to swap template0 and template1 instead? I.e. have
> template0 be in pg_database.dat and thus get a pinned oid, and then
> create template1, postgres etc from that?
No, *neither* of them are pinned, and we don't want them to be.
It's something of a historical artifact that template1 has a low OID.
>> + /*
>> + * Large objects are never pinned. We need this special case because
>> + * their OIDs can be user-assigned.
>> + */
>> + if (classId == LargeObjectRelationId)
>> + return false;
> Huh, shouldn't we reject that when creating them?
We've got regression tests that create blobs with small OIDs :-(.
We could change those tests of course, but they're pretty ancient
and I'm hesitant to move those goal posts.
> I guess you didn't because of dump/restore concerns?
That too.
In short, I'm really skeptical of changing any of these pin-or-not
decisions to save one or two comparisons in IsPinnedObject. That
function is already orders of magnitude faster than what it replaces;
we don't need to sweat over making it faster yet.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, andres@anarazel.de
Subject: Re: Replacing pg_depend PIN entries with a fixed range check
In-Reply-To: <3965335.1618531164@sss.pgh.pa.us>
References: <3737988.1618451008@sss.pgh.pa.us> <20210415234812.ylpcg3skayca7axw@alap3.anarazel.de> <3965335.1618531164@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox