Re: failed assertion in toasting code - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: failed assertion in toasting code
Date
Msg-id 87d4qrx0a3.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: failed assertion in toasting code  ("Sergey E. Koposov" <math@sai.msu.ru>)
Responses Re: failed assertion in toasting code  ("Sergey E. Koposov" <math@sai.msu.ru>)
List pgsql-hackers
"Sergey E. Koposov" <math@sai.msu.ru> writes:

> typedef struct
> {
>         int4 length;
>         unsigned char data[1];
> } image;
>
>         image *im = (image *) palloc(VARHDRSZ + out_len);
>         memset(im, 0, VARHDRSZ + out_len);
>      im->length = out_len + VARHDRSZ;

Ah, that's not going to work in 8.3 any longer. You have to change this to:

SET_VARSIZE(im, out_len+VARHDRSZ)

And you have to access the length with VARSIZE_ANY_EXHDR() (or a few other
macros but that's the most convenient).

Phew. You had me scared there.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Ask me about EnterpriseDB's Slony Replication
support!


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Permanent settings
Next
From: Andrew Dunstan
Date:
Subject: Re: More char()/ascii()