From 3d6fe7e6bb57081a9b7c3d5bcc23e5159ed65ba7 Mon Sep 17 00:00:00 2001
From: Emre Hasegeli <emre@hasegeli.com>
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 <replaceable class="parameter">numeric_literal</replaceable>, 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.
      </para>
 
      <para>
       If <literal>DROP EXPRESSION IF EXISTS</literal> is specified and the
       column is not a stored generated column, no error is thrown.  In this
       case a notice is issued instead.
      </para>
+
+     <note>
+      <para>
+       Turning a column into generated or changing the generation expression
+       is currently not supported.  To do that, use <command>DROP COLUMN</command>
+       and <command>CREATE COLUMN</command> with <command>GENERATED ALWAYS AS ( generation_expr ) STORED</command>.
+      </para>
+     </note>
     </listitem>
    </varlistentry>
 
    <varlistentry>
     <term><literal>ADD GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY</literal></term>
     <term><literal>SET GENERATED { ALWAYS | BY DEFAULT }</literal></term>
     <term><literal>DROP IDENTITY [ IF EXISTS ]</literal></term>
     <listitem>
      <para>
       These forms change whether a column is an identity column or change the
-- 
2.30.1 (Apple Git-130)

