Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
26e8a4f3
Commit
26e8a4f3
authored
23 years ago
by
Tom Lane
Browse files
Options
Downloads
Patches
Plain Diff
Repair erroneous ALTER DROP CONSTRAINT example.
parent
be4e5059
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/src/sgml/ref/alter_table.sgml
+10
-10
10 additions, 10 deletions
doc/src/sgml/ref/alter_table.sgml
with
10 additions
and
10 deletions
doc/src/sgml/ref/alter_table.sgml
+
10
−
10
View file @
26e8a4f3
<!--
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.3
0
2001/1
0/22 18:14:47 petere
Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.3
1
2001/1
1/10 20:13:37 tgl
Exp $
Postgres documentation
Postgres documentation
-->
-->
...
@@ -178,7 +178,7 @@ ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
...
@@ -178,7 +178,7 @@ ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
adds a new constraint to the table using the same syntax as <xref
adds a new constraint to the table using the same syntax as <xref
linkend="SQL-CREATETABLE">.
linkend="SQL-CREATETABLE">.
The DROP CONSTRAINT <replaceable class="PARAMETER">constraint</replaceable> clause
The DROP CONSTRAINT <replaceable class="PARAMETER">constraint</replaceable> clause
drops all
CHECK
constraints on the table (and its children) that match <replaceable class="PARAMETER">constraint</replaceable>.
drops all constraints on the table (and its children) that match <replaceable class="PARAMETER">constraint</replaceable>.
The OWNER clause changes the owner of the table to the user <replaceable class="PARAMETER">
The OWNER clause changes the owner of the table to the user <replaceable class="PARAMETER">
new user</replaceable>.
new user</replaceable>.
</para>
</para>
...
@@ -207,15 +207,15 @@ ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
...
@@ -207,15 +207,15 @@ ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
new default value, using <xref linkend="sql-update">.)
new default value, using <xref linkend="sql-update">.)
</para>
</para>
<para>
<para>
Currently only CHECK constraints can be dropped from a table. The RESTRICT
In DROP CONSTRAINT, the RESTRICT keyword is required, although
keyword is required, although dependencies are not checked. The CASCADE
dependencies are not yet checked. The CASCADE option is unsupported.
option is unsupported. To remove a PRIMARY or UNIQUE constraint, drop the
Currently DROP CONSTRAINT drops only CHECK constraints.
relevant index using the <xref linkend="SQL-DROPINDEX"> command.
To remove a PRIMARY or UNIQUE constraint, drop the
relevant index using the <xref linkend="SQL-DROPINDEX"> command.
To remove FOREIGN KEY constraints you need to recreate
To remove FOREIGN KEY constraints you need to recreate
and reload the table, using other parameters to the
and reload the table, using other parameters to the
<xref linkend="SQL-CREATETABLE">
<xref linkend="SQL-CREATETABLE"> command.
command.
</para>
</para>
<para>
<para>
For example, to drop all constraints on a table <literal>distributors</literal>:
For example, to drop all constraints on a table <literal>distributors</literal>:
...
@@ -277,7 +277,7 @@ ALTER TABLE distributors ADD CONSTRAINT zipchk CHECK (char_length(zipcode) = 5);
...
@@ -277,7 +277,7 @@ ALTER TABLE distributors ADD CONSTRAINT zipchk CHECK (char_length(zipcode) = 5);
<para>
<para>
To remove a check constraint from a table and all its children:
To remove a check constraint from a table and all its children:
<programlisting>
<programlisting>
ALTER TABLE distributors DROP CONSTRAINT zipchk;
ALTER TABLE distributors DROP CONSTRAINT zipchk
RESTRICT
;
</programlisting>
</programlisting>
</para>
</para>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment