Re: adding new pages bulky way - Mailing list pgsql-hackers

From Tom Lane
Subject Re: adding new pages bulky way
Date
Msg-id 26969.1118203952@sss.pgh.pa.us
Whole thread Raw
In response to Re: adding new pages bulky way  ("Victor Y. Yegorov" <viy@mits.lv>)
List pgsql-hackers
"Victor Y. Yegorov" <viy@mits.lv> writes:
> * Alvaro Herrera <alvherre@surnet.cl> [08.06.2005 00:39]:
>> Huh, why?  You need to grab the relation extension block
>> (LockRelationForExtension in CVS tip).

> Really? Didn't knew that. 

> Consider:
> 1) I add 2 pages to the newly-created relation
>    using P_NEW as BlockNumber;
> 2) then I do LockRelationForExtension; ReadBuffer(135) and
>    UnockRelationForExtension.

As things are set up at the moment, you really should not use
P_NEW at all unless you hold the relation extension lock.

(At least not for ordinary heap relations.  An index access
method could have its own rules about how to add blocks to
the relation --- hash does for instance.)

This is all pretty ugly in my view, and so I would not stand
opposed to ideas about a cleaner design ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Visibility issue with pg_table_is_visible
Next
From: Abhijit Menon-Sen
Date:
Subject: linuxtag 2005