Re: Virtual generated columns

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Virtual generated columns
Date: 2024-05-22 17:22:47
Message-ID: ffc0cb54-0666-4820-9baa-49d839007eef@eisentraut.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 29.04.24 10:23, Peter Eisentraut wrote:
> Here is a patch set to implement virtual generated columns.

> The main feature patch (0005 here) generally works but has a number of
> open corner cases that need to be thought about and/or fixed, many of
> which are marked in the code or the tests.  I'll continue working on
> that.  But I wanted to see if I can get some feedback on the test
> structure, so I don't have to keep changing it around later.

Here is an updated patch set. It needed some rebasing, especially
around the reverting of the catalogued not-null constraints. I have
also fixed up the various incomplete or "fixme" pieces of code mentioned
above. I have in most cases added "not supported yet" error messages
for now, with the idea that some of these things can be added in later,
as incremental features.

In particular, quoting from the commit message, the following are
currently not supported (but could possibly be added as incremental
features, some easier than others):

- index on virtual column
- expression index using a virtual column
- hence also no unique constraints on virtual columns
- not-null constraints on virtual columns
- (check constraints are supported)
- foreign key constraints on virtual columns
- extended statistics on virtual columns
- ALTER TABLE / SET EXPRESSION
- ALTER TABLE / DROP EXPRESSION
- virtual columns as trigger columns
- virtual column cannot have domain type

So, I think this basically works now, and the things that don't work
should be appropriately prevented. So if someone wants to test this and
tell me what in fact doesn't work correctly, that would be helpful.

Attachment Content-Type Size
v1-0001-Rename-regress-test-generated-to-generated_stored.patch text/plain 2.0 KB
v1-0002-Put-generated_stored-test-objects-in-a-schema.patch text/plain 18.9 KB
v1-0003-Remove-useless-initializations.patch text/plain 996 bytes
v1-0004-Remove-useless-code.patch text/plain 2.5 KB
v1-0005-Virtual-generated-columns.patch text/plain 175.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2024-05-22 17:25:46 Re: Schema variables - new implementation for Postgres 15
Previous Message Dave Page 2024-05-22 17:18:07 Re: zlib detection in Meson on Windows broken?