Size of TOAST pointer

From: Vignesh Raghunathan <vignesh(dot)pgsql(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Size of TOAST pointer
Date: 2015-07-16 22:36:54
Message-ID: CAD_AmVgQ6cHwCM_JoHH_vJmcLT6Q4tssNois1Un4AB=uXfVEBA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

I was looking at the documentation for TOAST (
http://www.postgresql.org/docs/devel/static/storage-toast.html) and it's
specified that the toast pointer occupies 18 bytes. However, the struct
representing the toast pointer is defined as follows

typedef struct varatt_external
{
int32 va_rawsize; /* Original data size
(includes header) */
int32 va_extsize; /* External saved size
(doesn't) */
Oid va_valueid; /* Unique ID of
value within TOAST table */
Oid va_toastrelid; /* RelID of TOAST table
containing it */
} varatt_external;

Assuming that the pointer is aligned to a 4 byte boundary, doesn't it sum
up to 16 bytes?

Could someone please explain why the documentation specifies it as 18 bytes?

I am pretty new to the source code and the C language in general so I
apologize if this question has an obvious answer.

Thanks,
Vignesh.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-07-16 22:49:58 Re: Size of TOAST pointer
Previous Message Ryan Pedela 2015-07-16 22:23:08 Re: [PATCH] Generalized JSON output functions