Re: Non-Stored Generated Columns

From: Dominique Devienne <ddevienne(at)gmail(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Non-Stored Generated Columns
Date: 2024-02-28 17:38:44
Message-ID: CAFCRh-_2Pz0ZE9QH4gr9qYQW9bEFsnXefZxryJyeD-AgcOQAsg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Feb 28, 2024 at 5:59 PM Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
wrote:

> On Wed, 2024-02-28 at 16:09 +0100, Dominique Devienne wrote:
> > From https://www.postgresql.org/docs/16/ddl-generated-columns.html:
> > > PostgreSQL currently implements only stored generated columns
> >
> > We use generated columns extensively.
> > And we have foreign-keys attached to those generated columns.
> > The fact they are always Stored thus wastes space in our case.
> > Any chance PostgreSQL might gain actual virtual / non-stored generated
> columns soon? Ever?
> >
> > For reference, both Oracle and SQLite have virtual / non-stored columns.
> > And both support FKs and indexes on those too.
> > Would be great to have feature parity on this particular point,
> eventually.
>
> Isn't almost all of that functionality covered by a view?
>

Views can have foreign-keys?
Generated view columns be indexed? (for efficient CASCADE of the FKs)

AFAIK, no. Plus that would double the relations in schemas too. --DD

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron Johnson 2024-02-28 18:14:26 Re: PostgreSQL Guard
Previous Message Adrian Klaver 2024-02-28 17:20:40 Re: Need Assistance: Command to display procedures does not work