From af2324fabf0020e464b0268be9ef03e8f46ed84b Mon Sep 17 00:00:00 2001
From: Peter Eisentraut
Date: Wed, 4 Oct 2023 15:03:48 +0200
Subject: doc: Clarify not-null constraints in information schema
Add a bit of clarification in various places that not-null constraints
are included under check constraints in the information schema.
---
doc/src/sgml/information_schema.sgml | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
(limited to 'doc/src')
diff --git a/doc/src/sgml/information_schema.sgml b/doc/src/sgml/information_schema.sgml
index d57a1323409..9c39e9aab50 100644
--- a/doc/src/sgml/information_schema.sgml
+++ b/doc/src/sgml/information_schema.sgml
@@ -917,6 +917,13 @@
domain is the owner of the constraint.)
+
+ The SQL standard considers not-null constraints to be check constraints
+ with a CHECK (column_name IS NOT
+ NULL) expression. So not-null constraints are also included here
+ and don't have a separate view.
+
+
check_constraints Columns
@@ -2116,7 +2123,9 @@
columns in the current database that are used by some constraint.
Only those columns are shown that are contained in a table owned by
a currently enabled role. For a check constraint, this view
- identifies the columns that are used in the check expression. For
+ identifies the columns that are used in the check expression. For a
+ not-null constraint, this view identifies the column that the constraint is
+ defined on. For
a foreign key constraint, this view identifies the columns that the
foreign key references. For a unique or primary key constraint,
this view identifies the constrained columns.
@@ -6856,7 +6865,7 @@ ORDER BY c.ordinal_position;
constraint_type character_data
- Type of the constraint: CHECK,
+ Type of the constraint: CHECK (includes not-null constraints),
FOREIGN KEY, PRIMARY KEY,
or UNIQUE
--
cgit v1.2.3