Skip to content

Commit 84f6d31

Browse files
author
Nikita Glukhov
committed
Fix alignment of custom TOAST pointers
1 parent cac32a9 commit 84f6d31

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/backend/access/common/heaptuple.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,15 @@ fill_val(Form_pg_attribute att,
242242
else
243243
{
244244
*infomask |= HEAP_HASEXTERNAL;
245-
/* no alignment, since it's short by definition */
245+
246+
/*
247+
* Align custom TOAST pointers. Ordinary pointers have
248+
* no alignment, since they are short by definition.
249+
*/
250+
if (VARATT_IS_CUSTOM(val))
251+
data = (char *) att_align_nominal(data,
252+
att->attalign);
253+
246254
data_length = VARSIZE_EXTERNAL(val);
247255
memcpy(data, val, data_length);
248256
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy