On Wed, Feb 28, 2024 at 2:11 PM Tom Lane <t...@sss.pgh.pa.us> wrote:

> Dominique Devienne <ddevie...@gmail.com> writes:
> > Views can have foreign-keys?
>
> Surely you'd put the FK on the underlying table.
>
> > Generated view columns be indexed?
>
> You want an index on a virtual column?  Sure, just build an expression
> index (on the underlying table) that matches it.
>
> I agree with Laurenz that it's hard to see much use-case here
> that's not sufficiently covered already.
>

Oracle and SQLite have them, so, by definition, *many* more than one person
(you don't get a feature added to Oracle that easily...) has seen
sufficient reasons for doing it instead of modifying the underlying table,
or building an expression index.

My guess as to why they do it is "clarity of design".

Reply via email to