Re: BUG #15653: pg_detoast_datum_packed problem - Mailing list pgsql-bugs

From Andrew Gierth
Subject Re: BUG #15653: pg_detoast_datum_packed problem
Date
Msg-id 87a7i5b2ok.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to Re: BUG #15653: pg_detoast_datum_packed problem  (gmail Vladimir Koković <vladimir.kokovic@gmail.com>)
Responses Re: BUG #15653: pg_detoast_datum_packed problem  (gmail Vladimir Koković <vladimir.kokovic@gmail.com>)
List pgsql-bugs
>>>>> "gmail" == gmail Vladimir Koković <vladimir.kokovic@gmail.com> writes:

 gmail>   VarChar *arg = PG_GETARG_VARCHAR_PP(0);

The _PP there means that this is allowed to return either a packed
(short) varlena or a normal one...

 gmail>     len = VARSIZE( arg ) - VARHDRSZ;

...but VARSIZE is only allowed on unpacked varlenas, you need to use
VARSIZE_ANY_EXHDR instead (and VARDATA_ANY rather than VARDATA).

--
Andrew (irc:RhodiumToad)


pgsql-bugs by date:

Previous
From: gmail Vladimir Koković
Date:
Subject: Re: BUG #15653: pg_detoast_datum_packed problem
Next
From: PG Bug reporting form
Date:
Subject: BUG #15679: Partial HASH index takes too much space