Re: ALTER COLUMN to change GENERATED ALWAYS AS expression?

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: ALTER COLUMN to change GENERATED ALWAYS AS expression?
Дата
Msg-id 6442cf200b9ba3d86e695172c4da98a802bda48e.camel@cybertec.at
обсуждение исходный текст
Ответ на ALTER COLUMN to change GENERATED ALWAYS AS expression?  (Philip Semanchuk <philip@americanefficient.com>)
Ответы Re: ALTER COLUMN to change GENERATED ALWAYS AS expression?  (Philip Semanchuk <philip@americanefficient.com>)
Список pgsql-general
On Mon, 2023-02-06 at 12:04 -0500, Philip Semanchuk wrote:
> I have a column defined GENERATED ALWAYS AS {my_expression} STORED. I’d like to change the
> {my_expression} part. After reading the documentation for ALTER TABLE
> (https://www.postgresql.org/docs/current/sql-altertable.html) and trying a few things that
> 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?

I think that is correct.  But changing the expression would mean rewriting the column
anyway.  The only downside is that a dropped column remains in the table, and no even
a VACUUM (FULL) will get rid of it.

Yours,
Laurenz Albe



В списке pgsql-general по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: Language options for GIN index support functions
Следующее
От: Rahila Syed
Дата:
Сообщение: Re: Logical Replication - "invalid ordering of speculative insertion changes"