Re: BRIN page type identifier - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: BRIN page type identifier
Date
Msg-id 20150310033642.GW3291@alvh.no-ip.org
Whole thread Raw
In response to Re: BRIN page type identifier  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Alvaro Herrera <alvherre@2ndquadrant.com> writes:

> > typedef struct BrinSpecialSpace
> > {
> >     char        padding[MAXALIGN(1) - 2 * sizeof(uint16)];
> >     uint16        flags;
> >     uint16        type;
> > } BrinSpecialSpace;
>
> I should expect that to fail altogether on 32-bit machines, because
> the declared array size will be zero.

Hah, of course.

> You could try something like
>
> typedef struct BrinSpecialSpace
> {
>     uint16        vector[MAXALIGN(1) / sizeof(uint16)];
> } BrinSpecialSpace;
>
> and then some access macros to use the last and next-to-last
> elements of that array.

Ah, thanks, that works fine on x86-64.  Here's a patch I intend to push
tomorrow.

Heikki suggested that the comment above GinPageOpaqueData be moved to
some better place, but I couldn't find any such.  If there are other
ideas, I'm all ears.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: Kouhei Kaigai
Date:
Subject: Re: Join push-down support for foreign tables
Next
From: Tom Lane
Date:
Subject: Re: BRIN page type identifier