Re: Non-transactional pg_class, try 2 - Mailing list pgsql-patches

From Tom Lane
Subject Re: Non-transactional pg_class, try 2
Date
Msg-id 28994.1150075892@sss.pgh.pa.us
Whole thread Raw
In response to Re: Non-transactional pg_class, try 2  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: Non-transactional pg_class, try 2  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-patches
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Tom Lane wrote:
>> Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
>>> Other two caveats are:
>>> 1. During bootstrap, RelationBuildLocalRelation creates nailed relations
>>> with hardcoded TID=(0,1).
>>
>> This seems dangerous; can't you set it to InvalidItemPointer instead?
>> If it's not used before fixed, this doesn't matter, and if someone
>> *does* try to use it, that will catch the problem.

> Doesn't work because the bootstrap system actually _writes_ there :-(  A
> workaround could be to disable writing in bootstrapping mode, and store
> InvalidItemPointer.  (Actually storing InvalidItemPointer was the first
> thing I did, but it crashed on bootstrap.)

Or, set it to (0,1) and reserve that TID as a dummy entry.  What I'm
afraid of here is scribbling on some other relation's entry.  I'd like
to see some defense against that, don't much care what.

We do plenty of disable-this-in-bootstrap-mode checks, so one more
doesn't seem like a problem; so the first solution may be better.

            regards, tom lane

pgsql-patches by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Non-transactional pg_class, try 2
Next
From: Alvaro Herrera
Date:
Subject: Re: The corresponding relminxid patch; try 1