ALTER COLUMN to change GENERATED ALWAYS AS expression? - Mailing list pgsql-general

From Philip Semanchuk
Subject ALTER COLUMN to change GENERATED ALWAYS AS expression?
Date
Msg-id 4C775CB6-D73C-42B6-A94E-40C495AAA521@americanefficient.com
Whole thread Raw
Responses Re: ALTER COLUMN to change GENERATED ALWAYS AS expression?  (Laurenz Albe <laurenz.albe@cybertec.at>)
List pgsql-general
Hi all,
I have a column defined GENERATED ALWAYS AS {my_expression} STORED. I’d like to change the {my_expression} part. After
readingthe documentation for ALTER TABLE (https://www.postgresql.org/docs/current/sql-altertable.html) and trying a few
thingsthat resulted in syntax errors, there doesn’t seem to be a way to alter the column’s GENERATED expression in
place.It seems like my only option is to drop and re-add the column. Is that correct?  

Thanks
Philip


pgsql-general by date:

Previous
From: Erik Wienhold
Date:
Subject: Re: Understanding years part of Interval
Next
From: Sebastien Flaesch
Date:
Subject: Get the sequence name corresponding to a GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY column