Re: pg18: Virtual generated columns are not (yet) safe when superuser selects from them - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: pg18: Virtual generated columns are not (yet) safe when superuser selects from them
Date
Msg-id b4babb8e58782e3c477ae2d8ccf237c4c35e8471.camel@j-davis.com
Whole thread Raw
In response to Re: pg18: Virtual generated columns are not (yet) safe when superuser selects from them  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, 2025-06-02 at 21:19 -0400, Tom Lane wrote:
> Maybe we can make a conservative approximation that's good
> enough to be useful, but I'm not certain.

Right. If the alternative is reverting the feature, the idea would be
to save it for at least some common use cases where the expression is
obviously safe.

>
> I'm leaning more and more to the position that we ought to revert
> virtual generated columns for v18 and give ourselves breathing
> room to design a proper fix for the security hazard.

Unfortunate, but I think I agree.

Even if we do come up with a useful definition of "safe", it would take
a while to sort through the use cases to see how much of the feature is
still usable within that definition.

However, I do think it's worth exploring some definition of a "safe"
expression in the v19 cycle. There's significant performance overhead
to wrapping the function as is done for SECURITY DEFINER, so if the
function is obviously safe, it would be nice to avoid that. And it
would be another tool to help us mitigate the various related problems
we have with selecting from views, etc.

Regards,
    Jeff Davis




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg18: Virtual generated columns are not (yet) safe when superuser selects from them
Next
From: Noah Misch
Date:
Subject: Re: Issues with 2PC at recovery: CLOG lookups and GlobalTransactionData