Re: Residual cleanups for tied objects in PL/Perl - Mailing list pgsql-hackers

From Andrey Rachitskiy
Subject Re: Residual cleanups for tied objects in PL/Perl
Date
Msg-id CAB8bMivZFmWh9vvkF5HBT+Cy9y=nA2NbGhxQapGPUaZ-mNerSA@mail.gmail.com
Whole thread
Responses Re: First draft of PG 19 release notes
List pgsql-hackers


пн, 17 авг. 2026 г. в 03:24, Andrey Rachitskiy <pl0h0yp1@gmail.com>:
The first patch tries to close every Perl-to-SQL path that still
ignored FETCH on tied values.

I have attached v2.

The previous version missed a few GETMAGIC call sites:
get_perl_array_ref(), the trigger return value, $_TD->{new} before
the SvOK() / SvROK() checks, and the start of return_next().  A tied
scalar whose FETCH returns an arrayref or a hashref still looked like
undef.

That also made the SETOF walker cleaner.  The loop only walks with
av_len() and calls return_next().  FETCH lives in return_next() and
plperl_sv_to_datum(), so the loop does not run GETMAGIC on each
element itself.

The regress patch covers those cases.  tied_scalar_setof and
tied_scalar_int_array wrap an arrayref in a tied scalar.  tied_modify
uses tied scalars for $_TD->{new} and for the "MODIFY" return.

--
Regards,
Rachitskiy Andrey
Attachment

pgsql-hackers by date:

Previous
From: Sergey Soloviev
Date:
Subject: Re: [PATCH] Do not flush BufFile for regular temp files
Next
From: Amit Kapila
Date:
Subject: Re: Logical replication row filter loses unchanged toasted columns