Re: BUG #18722: Processing arrays with plpgsql raises errors - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #18722: Processing arrays with plpgsql raises errors
Date
Msg-id 1440980.1732562171@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #18722: Processing arrays with plpgsql raises errors  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Responses Re: BUG #18722: Processing arrays with plpgsql raises errors
List pgsql-bugs
Dean Rasheed <dean.a.rasheed@gmail.com> writes:
> I didn't mean do it in all cases, I just meant the NullIfExpr case
> identified here. My point was that instead of modifying the evaluation
> code for EEOP_NULLIF to make it call
> MakeExpandedObjectReadOnlyInternal(), it would be easier to insert a
> EEOP_MAKE_READONLY step for the first argument of the EEOP_NULLIF
> step.

But then the NULLIF step would only have access to the R/O pointer,
no?  We do want to pass on a R/W pointer to the output, if we got
one, to handle cases like
    fconsumer(NULLIF(fproducer(...), ...), ...)
Admittedly that's a pretty edgy edge-case, but still we're leaving
money on the table if we don't do it.  So I think we have to deal
with the issue within NULLIF.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Dean Rasheed
Date:
Subject: Re: BUG #18722: Processing arrays with plpgsql raises errors
Next
From: Thomas Munro
Date:
Subject: Re: Build failure with GCC 15 (defaults to -std=gnu23)