Missing generated column in ALTER TABLE ADD COLUMN doc

Started by Masahiko Sawadaover 6 years ago5 messages
#1Masahiko Sawada
sawada.mshk@gmail.com
1 attachment(s)

Hi,

We support ALTER TABLE ADD COLUMN .. GENERATED ALWAYS AS .. but the
doc is missing it. Attached small patch fixes this.

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

Attachments:

doc_alter_column_add_generated_column.patchapplication/octet-stream; name=doc_alter_column_add_generated_column.patchDownload
diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml
index 49b081a..f5ad765 100644
--- a/doc/src/sgml/ref/alter_table.sgml
+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -98,6 +98,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
   NULL |
   CHECK ( <replaceable class="parameter">expression</replaceable> ) [ NO INHERIT ] |
   DEFAULT <replaceable>default_expr</replaceable> |
+  GENERATED ALWAYS AS ( <replaceable>generation_expr</replaceable> ) STORED |
   GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY [ ( <replaceable>sequence_options</replaceable> ) ] |
   UNIQUE <replaceable class="parameter">index_parameters</replaceable> |
   PRIMARY KEY <replaceable class="parameter">index_parameters</replaceable> |
#2Michael Paquier
michael@paquier.xyz
In reply to: Masahiko Sawada (#1)
Re: Missing generated column in ALTER TABLE ADD COLUMN doc

On Fri, Jun 07, 2019 at 06:07:34PM +0900, Masahiko Sawada wrote:

We support ALTER TABLE ADD COLUMN .. GENERATED ALWAYS AS .. but the
doc is missing it. Attached small patch fixes this.

Your patch updates the section related to constraint_name. Don't you
need an extra line for the "action" part?
--
Michael

#3Masahiko Sawada
sawada.mshk@gmail.com
In reply to: Michael Paquier (#2)
Re: Missing generated column in ALTER TABLE ADD COLUMN doc

On Mon, Jun 10, 2019 at 5:05 PM Michael Paquier <michael@paquier.xyz> wrote:

On Fri, Jun 07, 2019 at 06:07:34PM +0900, Masahiko Sawada wrote:

We support ALTER TABLE ADD COLUMN .. GENERATED ALWAYS AS .. but the
doc is missing it. Attached small patch fixes this.

Your patch updates the section related to constraint_name. Don't you
need an extra line for the "action" part?

We already have the following line in action part but you mean we need
an extra line for that?

ADD [ COLUMN ] [ IF NOT EXISTS ] column_name data_type [ COLLATE
collation ] [ column_constraint [ ... ] ]

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

#4Michael Paquier
michael@paquier.xyz
In reply to: Masahiko Sawada (#3)
Re: Missing generated column in ALTER TABLE ADD COLUMN doc

On Mon, Jun 10, 2019 at 06:09:53PM +0900, Masahiko Sawada wrote:

We already have the following line in action part but you mean we need
an extra line for that?

ADD [ COLUMN ] [ IF NOT EXISTS ] column_name data_type [ COLLATE
collation ] [ column_constraint [ ... ] ]

I was looking at the grammar extensions for ADD GENERATED and noticed
what looked like inconsistencies, but your patch as well as the parsed
query are right. Committed, thanks!
--
Michael

#5Masahiko Sawada
sawada.mshk@gmail.com
In reply to: Michael Paquier (#4)
Re: Missing generated column in ALTER TABLE ADD COLUMN doc

On Tue, Jun 11, 2019 at 1:02 PM Michael Paquier <michael@paquier.xyz> wrote:

On Mon, Jun 10, 2019 at 06:09:53PM +0900, Masahiko Sawada wrote:

We already have the following line in action part but you mean we need
an extra line for that?

ADD [ COLUMN ] [ IF NOT EXISTS ] column_name data_type [ COLLATE
collation ] [ column_constraint [ ... ] ]

I was looking at the grammar extensions for ADD GENERATED and noticed
what looked like inconsistencies, but your patch as well as the parsed
query are right. Committed, thanks!

Thank you!

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center