Re: BRIN page type identifier

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: BRIN page type identifier
Date: 2015-03-10 03:36:42
Message-ID: 20150310033642.GW3291@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Alvaro Herrera <alvherre(at)2ndquadrant(dot)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 Content-Type Size
brin-pagetype.patch text/x-diff 8.8 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-03-10 03:39:11 Re: BRIN page type identifier
Previous Message Kouhei Kaigai 2015-03-10 03:18:41 Re: Custom/Foreign-Join-APIs (Re: [v9.5] Custom Plan API)