Hi,
I would like to implement a function that simply returns its argument
(for the unary plus operator of a custum data type).
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) {
Jan Behrens 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 t
On Sat, Dec 14, 2024 at 12:02 PM Tom Lane wrote:
> Jan Behrens 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));
> > }
>
> Absol
Ron Johnson writes:
> 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?
Probably not much. There are scenarios where not detoasting
saves work overal