Re: Allowed to return possibly TOASTed datums? - Mailing list pgsql-general

From Ron Johnson
Subject Re: Allowed to return possibly TOASTed datums?
Date
Msg-id CANzqJaCngKMjcxtzHPggWV3mQU8U2E0zqxDtkznSpQbmPgTCgg@mail.gmail.com
Whole thread Raw
In response to Re: Allowed to return possibly TOASTed datums?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Allowed to return possibly TOASTed datums?
List pgsql-general
On Sat, Dec 14, 2024 at 12:02 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Jan Behrens <jbe-mlist@magnetkern.de> writes:
> Is it allowed to use the following function, assuming the data type is
> TOASTable?

> PG_FUNCTION_INFO_V1(mytype_pos);
> Datum mytype_pos(PG_FUNCTION_ARGS) {                             
>   PG_RETURN_DATUM(GETARG_DATUM(0));
> }

Absolutely.  You can find things equivalent to that in the
core code, I think.

(I'm not a developer, so this is a curiosity question, not a challenge.)

Since the purpose of TOAST is just (I think) to store "large field values" on disk by dividing into multiple chunks, what would be the purpose of returning the TOASTed value to Jan's function?

--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Allowed to return possibly TOASTed datums?
Next
From: Tom Lane
Date:
Subject: Re: Allowed to return possibly TOASTed datums?