Hi

Depends on usage, but often times the detoasting is called from
DatumGet***** macros

The values are detoasted only when it is required

#define PG_GETARG_TEXT_PP(n)   DatumGetTextPP(PG_GETARG_DATUM(n))
#define DatumGetTextPP(X)              ((text *) PG_DETOAST_DATUM_PACKED(X))
#define PG_DETOAST_DATUM(datum)   >pg_detoast_datum((struct varlena *)
DatumGetPointer(datum))

Regards

Pavel Stehule

2015-05-06 15:00 GMT+02:00 Rui Hai Jiang <ruihaiji...@msn.com>:

> Hello,
>
> I've been reading the PostgreSQL code for weeks to figure out how TOAST
> works.
> I couldn't find where are the TOAST function called to detoast a tuple
> comes from a select query, for example, select * from table_name.
> Does anyone know this? Can you give me some help? And any help would save
> me a lot of time.
>
> Thanks,
> Rui Hai
>
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

Reply via email to