public inbox for [email protected]  
help / color / mirror / Atom feed
From: Ron Johnson <[email protected]>
To: pgsql-generallists.postgresql.org <[email protected]>
Subject: Re: Allowed to return possibly TOASTed datums?
Date: Sat, 14 Dec 2024 13:13:55 -0500
Message-ID: <CANzqJaCngKMjcxtzHPggWV3mQU8U2E0zqxDtkznSpQbmPgTCgg@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>

On Sat, Dec 14, 2024 at 12:02 PM Tom Lane <[email protected]> wrote:

> Jan Behrens <[email protected]> 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!


view thread (4+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Allowed to return possibly TOASTed datums?
  In-Reply-To: <CANzqJaCngKMjcxtzHPggWV3mQU8U2E0zqxDtkznSpQbmPgTCgg@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox