Re: pg18: Virtual generated columns are not (yet) safe when superuser selects from them

From: Christoph Berg <myon(at)debian(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org>, Feike Steenbergen <feikesteenbergen(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg18: Virtual generated columns are not (yet) safe when superuser selects from them
Date: 2025-06-05 16:03:51
Message-ID: aEG_5yD8Auc3bppU@msg.df7cb.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Re: Tom Lane
> > Extending the idea, perhaps the check could be moved to run-time and
> > recursively check that only immutable functions are called, including
> > user-defined immutable functions?
>
> I don't think I'd trust that. UDFs can claim to be immutable but
> be lying about it.

That's why I said "recursively". Then truly immutable user-defined
functions could still be used.

But practically, people will probably want to select from other tables
anyway (I've already had to tell a customer that virtual columns do
not allow that), so the use-case for user immutable functions is
probably very thin.

Christoph

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2025-06-05 16:04:01 Re: postmaster uses more CPU in 18 beta1 with io_method=io_uring
Previous Message David G. Johnston 2025-06-05 15:57:44 Possibly hard-to-read message