Hello,

As Amit Langot pointed out, the column_constraint definition is missing
whereas it is used in ALTER TABLE synopsis. It can be easily found in the
CREATE TABLE synopsis, but it's not very user friendly.

I simply copied/paste the column_constraint definition from the CREATE
TABLE synopsis to the ALTER TABLE synopsis. I also had to change the first
word "where" to "and" as it's not the first definition in that synopsis.

I choose to add it above table_constraint as column_constraint is used
before table_constraint.

The patch should apply to MASTER (or I messed up with git). I built and
tested it successfully on my laptop.

You will find enclosed my patch.

Regards,

Lætitia
diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml
index 41acda0..c02dc38 100644
*** a/doc/src/sgml/ref/alter_table.sgml
--- b/doc/src/sgml/ref/alter_table.sgml
***************
*** 85,90 **** ALTER TABLE [ IF EXISTS ] <replaceable class="parameter">name</replaceable>
--- 85,104 ----
      OWNER TO { <replaceable class="parameter">new_owner</replaceable> | CURRENT_USER | SESSION_USER }
      REPLICA IDENTITY { DEFAULT | USING INDEX <replaceable class="parameter">index_name</replaceable> | FULL | NOTHING }
  
+ <phrase>and <replaceable class="parameter">column_constraint</replaceable> is:</phrase>
+ 
+ [ CONSTRAINT <replaceable class="parameter">constraint_name</replaceable> ]
+ { NOT NULL |
+   NULL |
+   CHECK ( <replaceable class="parameter">expression</replaceable> ) [ NO INHERIT ] |
+   DEFAULT <replaceable>default_expr</replaceable> |
+   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> |
+   REFERENCES <replaceable class="parameter">reftable</replaceable> [ ( <replaceable class="parameter">refcolumn</replaceable> ) ] [ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ]
+     [ ON DELETE <replaceable class="parameter">action</replaceable> ] [ ON UPDATE <replaceable class="parameter">action</replaceable> ] }
+ [ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ]
+ 
  <phrase>and <replaceable class="parameter">table_constraint</replaceable> is:</phrase>
  
  [ CONSTRAINT <replaceable class="parameter">constraint_name</replaceable> ]
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to