Re: support create index on virtual generated column.

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: Kirill Reshke <reshkekirill(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: support create index on virtual generated column.
Date: 2025-04-15 08:36:46
Message-ID: CACJufxFx2zmTnTrGaxfNpRpy3RbY9wpjBXqvfP5dWoxsW9f_FQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Apr 14, 2025 at 8:05 PM Kirill Reshke <reshkekirill(at)gmail(dot)com> wrote:
>
> On Mon, 14 Apr 2025 at 16:10, jian he <jian(dot)universality(at)gmail(dot)com> wrote:
> >
> > new patch attached. Now,
> > ALTER TABLE DROP COLUMN works fine.
> > ALTER INDEX ATTACH PARTITION works fine.
> > creating such an index on a partitioned table works just fine.
> > for table inheritance: create index on parent table will not cascade
> > to child table,
> > so we don't need to worry about this.
>
> Hi! I reviewed v2, and it seems to be working now.
>
> But there are tests that are comment-out, what is their purpose? I
> note that commit 83ea6c5 also included some commented tests, so
> perhaps there's a reason I'm not aware of.
>

> ```
> ALTER TABLE gtest22c DROP COLUMN e;
> \d gtest22c
>
> -- EXPLAIN (COSTS OFF) SELECT * FROM gtest22c WHERE b * 3 = 6;
> -- SELECT * FROM gtest22c WHERE b * 3 = 6;
> -- EXPLAIN (COSTS OFF) SELECT * FROM gtest22c WHERE a = 1 AND b > 0;
> -- SELECT * FROM gtest22c WHERE a = 1 AND b > 0;
> ```

comment out tests are for to be implemented feature.
There are some test changes that are indeed not necessary, I restored it back,
please check attached.

Attachment Content-Type Size
v3-0001-index-on-virtual-generated-column.patch text/x-patch 54.4 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2025-04-15 08:47:23 Re: use correct variable in error message in _allocAH function (pg_backup_archiver.c)
Previous Message Fujii Masao 2025-04-15 08:02:51 Re: use correct variable in error message in _allocAH function (pg_backup_archiver.c)