Re: GiST on 64-bit box - Mailing list pgsql-hackers

From Teodor Sigaev
Subject Re: GiST on 64-bit box
Date
Msg-id 3C6793E5.2050601@stack.net
Whole thread Raw
In response to GiST on 64-bit box  (Teodor Sigaev <teodor@stack.net>)
Responses Re: GiST on 64-bit box
List pgsql-hackers
This patch solve the problem with unaligned access on 64-bit box. Please apply
it for 7.2.1.

Tested on DEC Alpha.

Tom Lane wrote:

> Actually, there is a third possibility, which would fix the problem
> without requiring any changes in the picksplit functions.  You could
> do this:
>
>     char *storage;
>
>     storage = palloc(MAXALIGN(VARHDRSZ) + (*len + 1) * sizeof(GISTENTRY));
>     entryvec = (bytea *) (storage + MAXALIGN(VARHDRSZ) - VARHDRSZ);
>
>     use entryvec as before, except final pfree is pfree(storage)
>
> Grotty as heck, but probably the right answer for 7.2.1 to avoid the
> initdb issues.
>
> For 7.3 we could do it the other, cleaner way.
>
>             regards, tom lane
>
>


--
Teodor Sigaev
teodor@stack.net


Attachment

pgsql-hackers by date:

Previous
From: "Andrea Aime"
Date:
Subject: Re: Fetature enhancement request : use of libgda in PostgreSQL
Next
From: Lee Kindness
Date:
Subject: Re: IFNULL -> COALESCE