Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 9ce04b5

Browse files
committed
Revert "Catalog NOT NULL constraints" and fallout
This reverts commit e056c55 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
1 parent 8e82db9 commit 9ce04b5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+625
-2874
lines changed

doc/src/sgml/catalogs.sgml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2552,7 +2552,6 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</replaceable>:<replaceable>&l
25522552
<para>
25532553
<literal>c</literal> = check constraint,
25542554
<literal>f</literal> = foreign key constraint,
2555-
<literal>n</literal> = not null constraint,
25562555
<literal>p</literal> = primary key constraint,
25572556
<literal>u</literal> = unique constraint,
25582557
<literal>t</literal> = constraint trigger,

doc/src/sgml/ref/alter_table.sgml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
117117
PRIMARY KEY ( <replaceable class="parameter">column_name</replaceable> [, ... ] ) <replaceable class="parameter">index_parameters</replaceable> |
118118
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> ) ] |
119119
FOREIGN KEY ( <replaceable class="parameter">column_name</replaceable> [, ... ] ) REFERENCES <replaceable class="parameter">reftable</replaceable> [ ( <replaceable class="parameter">refcolumn</replaceable> [, ... ] ) ]
120-
[ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ] [ ON DELETE <replaceable class="parameter">referential_action</replaceable> ] [ ON UPDATE <replaceable class="parameter">referential_action</replaceable> ] |
121-
NOT NULL <replaceable class="parameter">column_name</replaceable> [ NO INHERIT ]
122-
}
120+
[ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ] [ ON DELETE <replaceable class="parameter">referential_action</replaceable> ] [ ON UPDATE <replaceable class="parameter">referential_action</replaceable> ] }
123121
[ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ]
124122

125123
<phrase>and <replaceable class="parameter">table_constraint_using_index</replaceable> is:</phrase>
@@ -1765,17 +1763,11 @@ ALTER TABLE measurement
17651763
<title>Compatibility</title>
17661764

17671765
<para>
1768-
The forms <literal>ADD COLUMN</literal>
1766+
The forms <literal>ADD</literal> (without <literal>USING INDEX</literal>),
17691767
<literal>DROP [COLUMN]</literal>, <literal>DROP IDENTITY</literal>, <literal>RESTART</literal>,
17701768
<literal>SET DEFAULT</literal>, <literal>SET DATA TYPE</literal> (without <literal>USING</literal>),
17711769
<literal>SET GENERATED</literal>, and <literal>SET <replaceable>sequence_option</replaceable></literal>
1772-
conform with the SQL standard.
1773-
The form <literal>ADD <replaceable>table_constraint</replaceable></literal>
1774-
conforms with the SQL standard when the <literal>USING INDEX</literal> and
1775-
<literal>NOT VALID</literal> clauses are omitted and the constraint type is
1776-
one of <literal>UNIQUE</literal>, <literal>PRIMARY KEY</literal>
1777-
or <literal>REFERENCES</literal>.
1778-
The other forms are
1770+
conform with the SQL standard. The other forms are
17791771
<productname>PostgreSQL</productname> extensions of the SQL standard.
17801772
Also, the ability to specify more than one manipulation in a single
17811773
<command>ALTER TABLE</command> command is an extension.

doc/src/sgml/ref/create_table.sgml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXI
7777

7878
[ CONSTRAINT <replaceable class="parameter">constraint_name</replaceable> ]
7979
{ CHECK ( <replaceable class="parameter">expression</replaceable> ) [ NO INHERIT ] |
80-
NOT NULL <replaceable class="parameter">column_name</replaceable> |
8180
UNIQUE [ NULLS [ NOT ] DISTINCT ] ( <replaceable class="parameter">column_name</replaceable> [, ... ] ) <replaceable class="parameter">index_parameters</replaceable> |
8281
PRIMARY KEY ( <replaceable class="parameter">column_name</replaceable> [, ... ] ) <replaceable class="parameter">index_parameters</replaceable> |
8382
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
23152314
constraint, and index names must be unique across all relations within
23162315
the same schema.
23172316
</para>
2317+
2318+
<para>
2319+
Currently, <productname>PostgreSQL</productname> does not record names
2320+
for <literal>NOT NULL</literal> constraints at all, so they are not
2321+
subject to the uniqueness restriction. This might change in a future
2322+
release.
2323+
</para>
23182324
</refsect2>
23192325

23202326
<refsect2>

0 commit comments

Comments
 (0)