Re: Allowed to return possibly TOASTed datums?

From: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
To: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Allowed to return possibly TOASTed datums?
Date: 2024-12-14 18:13:55
Message-ID: CANzqJaCngKMjcxtzHPggWV3mQU8U2E0zqxDtkznSpQbmPgTCgg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Dec 14, 2024 at 12:02 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Jan Behrens <jbe-mlist(at)magnetkern(dot)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!

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2024-12-14 21:37:30 Re: Allowed to return possibly TOASTed datums?
Previous Message Tom Lane 2024-12-14 17:01:49 Re: Allowed to return possibly TOASTed datums?