From 3d6fe7e6bb57081a9b7c3d5bcc23e5159ed65ba7 Mon Sep 17 00:00:00 2001 From: Emre Hasegeli Date: Sun, 30 May 2021 16:11:30 +0300 Subject: [PATCH] doc: Note that ALTER TABLE cannot alter generated stored ALTER TABLE supports altering generated identity columns which could confuse the reader as they share syntax with generated stored columns. Clarify that a column cannot be turned into generated stored or generation expressions cannot be changed with a note. --- doc/src/sgml/ref/alter_table.sgml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml index 939d3fe273..0e9846153e 100644 --- a/doc/src/sgml/ref/alter_table.sgml +++ b/doc/src/sgml/ref/alter_table.sgml @@ -251,20 +251,28 @@ WITH ( MODULUS numeric_literal, REM This form turns a stored generated column into a normal base column. Existing data in the columns is retained, but future changes will no longer apply the generation expression. If DROP EXPRESSION IF EXISTS is specified and the column is not a stored generated column, no error is thrown. In this case a notice is issued instead. + + + + Turning a column into generated or changing the generation expression + is currently not supported. To do that, use DROP COLUMN + and CREATE COLUMN with GENERATED ALWAYS AS ( generation_expr ) STORED. + + ADD GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY SET GENERATED { ALWAYS | BY DEFAULT } DROP IDENTITY [ IF EXISTS ] These forms change whether a column is an identity column or change the -- 2.30.1 (Apple Git-130)