Re: Add a filed to PageHeaderData

From: Soroosh Sardari <soroosh(dot)sardari(at)gmail(dot)com>
To: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
Cc: Greg Stark <stark(at)mit(dot)edu>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add a filed to PageHeaderData
Date: 2014-06-24 09:51:24
Message-ID: CAFUsPDb0BQvENYqmL2J+heCXBWDTWmjBRxWsotdLuDvsaTEU2Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jun 24, 2014 at 1:34 PM, Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
wrote:

> On Tue, Jun 24, 2014 at 2:28 PM, Greg Stark <stark(at)mit(dot)edu> wrote:
>
>> On Tue, Jun 24, 2014 at 12:02 AM, Soroosh Sardari
>> <soroosh(dot)sardari(at)gmail(dot)com> wrote:
>> > Is there any rule for adding a field to PageHeaderData?
>>
>> Not really. It's a pretty internal thing, not something we expect
>> people to be doing all the time.
>>
>> The only rule I can think of is that you should bump some version
>> numbers such as the page format version and probably the catalog
>> version. But that's probably irrelevant to your problem. It sounds
>> like you have a bug in your code but you haven't posted enough
>> information to say much more.
>>
>>
> Out of curiosity, I actually tried adding a char[20] field in the page
> header because just like you I thought this should be completely internal,
> as long as the field is added before the pd_linp[] field. But I get the
> same failure that OP is reporting. I wonder if its a bug in gist index
> build, though I could not spot anything at the first glance. FWIW changing
> the char[] from 20 to 22 or 24 does not cause any failure in rangetypes
> test. So I am thinking its some alignment issue (mine is a 64 bit build)
>
> Thanks,
> Pavan
> --
> Pavan Deolasee
> http://www.linkedin.com/in/pavandeolasee
>

I check this problem with a virgin source code of postgresql-9.3.2. So the
bug is not for my codes.
As Pavan said, may be some alignment issues cause this problem.
By the way, following code has two different output and it is weird.

drop table if exists test_range_spgist;
create table test_range_spgist(ir int4range);
create index test_range_spgist_idx on test_range_spgist using spgist (ir);
insert into test_range_spgist select int4range(g, g+10) from
generate_series(1,590) g;

SET enable_seqscan = t;
SET enable_indexscan = f;
SET enable_bitmapscan = f;

select * from test_range_spgist where ir -|- int4range(100,500);

SET enable_seqscan = f;
SET enable_indexscan = t;
SET enable_bitmapscan = f;

select * from test_range_spgist where ir -|- int4range(100,500);

Regards,
Soroosh

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Abhijit Menon-Sen 2014-06-24 10:09:15 Re: Add a filed to PageHeaderData
Previous Message Christian Ullrich 2014-06-24 09:24:43 Re: PostgreSQL in Windows console and Ctrl-C