Re: BRIN page type identifier

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BRIN page type identifier
Дата
Msg-id 8620.1425944081@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BRIN page type identifier  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: BRIN page type identifier  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Re: BRIN page type identifier  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> I wonder if this is permissible and whether it will do the right thing
> on 32-bit systems:

> /*
>  * Special area of BRIN pages.
>  *
>  * We add some padding bytes to ensure that 'type' ends up in the last two
>  * bytes of the page, for consumption by pg_filedump and similar utilities.
>  * (Special space is MAXALIGN'ed).
>  */
> 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.

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.
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andreas Karlsson
Дата:
Сообщение: Re: patch : Allow toast tables to be moved to a different tablespace
Следующее
От: Jeff Janes
Дата:
Сообщение: Re: Documentation of bt_page_items()'s ctid field