mirror of
https://github.com/postgres/postgres.git
synced 2025-10-25 13:17:41 +03:00
Revert "Catalog NOT NULL constraints" and fallout
This reverts commit e056c557ae and minor later fixes thereof.
There's a few problems in this new feature -- most notably regarding
pg_upgrade behavior, but others as well. This new feature is not in any
way critical on its own, so instead of scrambling to fix it we revert it
and try again in early 17 with these issues in mind.
Discussion: https://postgr.es/m/3801207.1681057430@sss.pgh.pa.us
This commit is contained in:
@@ -2552,7 +2552,6 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l
|
||||
<para>
|
||||
<literal>c</literal> = check constraint,
|
||||
<literal>f</literal> = foreign key constraint,
|
||||
<literal>n</literal> = not null constraint,
|
||||
<literal>p</literal> = primary key constraint,
|
||||
<literal>u</literal> = unique constraint,
|
||||
<literal>t</literal> = constraint trigger,
|
||||
|
||||
@@ -117,9 +117,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
|
||||
PRIMARY KEY ( <replaceable class="parameter">column_name</replaceable> [, ... ] ) <replaceable class="parameter">index_parameters</replaceable> |
|
||||
EXCLUDE [ USING <replaceable class="parameter">index_method</replaceable> ] ( <replaceable class="parameter">exclude_element</replaceable> WITH <replaceable class="parameter">operator</replaceable> [, ... ] ) <replaceable class="parameter">index_parameters</replaceable> [ WHERE ( <replaceable class="parameter">predicate</replaceable> ) ] |
|
||||
FOREIGN KEY ( <replaceable class="parameter">column_name</replaceable> [, ... ] ) REFERENCES <replaceable class="parameter">reftable</replaceable> [ ( <replaceable class="parameter">refcolumn</replaceable> [, ... ] ) ]
|
||||
[ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ] [ ON DELETE <replaceable class="parameter">referential_action</replaceable> ] [ ON UPDATE <replaceable class="parameter">referential_action</replaceable> ] |
|
||||
NOT NULL <replaceable class="parameter">column_name</replaceable> [ NO INHERIT ]
|
||||
}
|
||||
[ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ] [ ON DELETE <replaceable class="parameter">referential_action</replaceable> ] [ ON UPDATE <replaceable class="parameter">referential_action</replaceable> ] }
|
||||
[ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ]
|
||||
|
||||
<phrase>and <replaceable class="parameter">table_constraint_using_index</replaceable> is:</phrase>
|
||||
@@ -1765,17 +1763,11 @@ ALTER TABLE measurement
|
||||
<title>Compatibility</title>
|
||||
|
||||
<para>
|
||||
The forms <literal>ADD COLUMN</literal>
|
||||
The forms <literal>ADD</literal> (without <literal>USING INDEX</literal>),
|
||||
<literal>DROP [COLUMN]</literal>, <literal>DROP IDENTITY</literal>, <literal>RESTART</literal>,
|
||||
<literal>SET DEFAULT</literal>, <literal>SET DATA TYPE</literal> (without <literal>USING</literal>),
|
||||
<literal>SET GENERATED</literal>, and <literal>SET <replaceable>sequence_option</replaceable></literal>
|
||||
conform with the SQL standard.
|
||||
The form <literal>ADD <replaceable>table_constraint</replaceable></literal>
|
||||
conforms with the SQL standard when the <literal>USING INDEX</literal> and
|
||||
<literal>NOT VALID</literal> clauses are omitted and the constraint type is
|
||||
one of <literal>UNIQUE</literal>, <literal>PRIMARY KEY</literal>
|
||||
or <literal>REFERENCES</literal>.
|
||||
The other forms are
|
||||
conform with the SQL standard. The other forms are
|
||||
<productname>PostgreSQL</productname> extensions of the SQL standard.
|
||||
Also, the ability to specify more than one manipulation in a single
|
||||
<command>ALTER TABLE</command> command is an extension.
|
||||
|
||||
@@ -77,7 +77,6 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXI
|
||||
|
||||
[ CONSTRAINT <replaceable class="parameter">constraint_name</replaceable> ]
|
||||
{ CHECK ( <replaceable class="parameter">expression</replaceable> ) [ NO INHERIT ] |
|
||||
NOT NULL <replaceable class="parameter">column_name</replaceable> |
|
||||
UNIQUE [ NULLS [ NOT ] DISTINCT ] ( <replaceable class="parameter">column_name</replaceable> [, ... ] ) <replaceable class="parameter">index_parameters</replaceable> |
|
||||
PRIMARY KEY ( <replaceable class="parameter">column_name</replaceable> [, ... ] ) <replaceable class="parameter">index_parameters</replaceable> |
|
||||
EXCLUDE [ USING <replaceable class="parameter">index_method</replaceable> ] ( <replaceable class="parameter">exclude_element</replaceable> WITH <replaceable class="parameter">operator</replaceable> [, ... ] ) <replaceable class="parameter">index_parameters</replaceable> [ WHERE ( <replaceable class="parameter">predicate</replaceable> ) ] |
|
||||
@@ -2315,6 +2314,13 @@ CREATE TABLE cities_partdef
|
||||
constraint, and index names must be unique across all relations within
|
||||
the same schema.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Currently, <productname>PostgreSQL</productname> does not record names
|
||||
for <literal>NOT NULL</literal> constraints at all, so they are not
|
||||
subject to the uniqueness restriction. This might change in a future
|
||||
release.
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<refsect2>
|
||||
|
||||
Reference in New Issue
Block a user