Re: altering a column to to make it generated - Mailing list pgsql-general

From Tom Lane
Subject Re: altering a column to to make it generated
Date
Msg-id 3155442.1713816703@sss.pgh.pa.us
Whole thread Raw
In response to Re: altering a column to to make it generated  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Mon, Apr 22, 2024 at 12:42 PM Celia McInnis <celia.mcinnis@gmail.com>
> wrote:
>> Can I alter a table column to now make it generated? I tried this
>> unsuccessfully:

> I looked at all of the "alter table ... alter column" commands listed here:
> https://www.postgresql.org/docs/current/sql-altertable.html
> And none seem to involve the generated expression column.  So the answer is
> no.

I think what you'd need to do is drop the existing column
and then add a generated column.

            regards, tom lane



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: altering a column to to make it generated
Next
From: Atul Kumar
Date:
Subject: issue with reading hostname