From: | jian he <jian(dot)universality(at)gmail(dot)com> |
---|---|
To: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: support ALTER TABLE DROP EXPRESSION for virtual generated column |
Date: | 2025-03-29 08:12:24 |
Message-ID: | CACJufxEPiyZXXeGZF=8o10r8_Cj-CfLVsJfHkfe2uxUdw1GnkQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Thu, Mar 27, 2025 at 11:44 AM David G. Johnston
<david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
>
> On Wednesday, March 26, 2025, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>
>> jian he <jian(dot)universality(at)gmail(dot)com> writes:
>> > the attached patch is to implement $subject.
>>
>> Why would this be a good idea? I don't see any principled fallback
>> definition of the column. (No, "NULL" is not that.) Certainly we
>> should support ALTER TABLE DROP COLUMN, but removing the expression
>> and not providing a substitute seems semantically nonsensical.
>
>
> I don’t follow how NULL got involved in this discussion. The proposal is basically: turn the virtual expression into an equivalent stored expression, then drop the expression.
>
This discussion [0] wants to change stored to virtual.
drop the virtual generation, not materialize, column value will be NULL,
but that will not work because commit [1]
So we are either saying that
virtual generation expression cannot be dropped, you can only
substitute another expression
or drop the expression, based on the dropped expression materializing
that column value.
[0]: https://postgr.es/m/CAFCRh-8grTkEy%2B73q79iXB%2Bq%2BsD%3DQkbz-vNAN1KJCF6PRLa%3Dzg%40mail.gmail.com
[1]: https://git.postgresql.org/cgit/postgresql.git/commit/?id=cdc168ad4b22ea4183f966688b245cabb5935d1f
From | Date | Subject | |
---|---|---|---|
Next Message | Sutou Kouhei | 2025-03-29 08:57:53 | Re: Make COPY format extendable: Extract COPY TO format implementations |
Previous Message | Krasiyan Andreev | 2025-03-29 07:51:55 | Re: Add RESPECT/IGNORE NULLS and FROM FIRST/LAST options |