aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-12-12 20:35:16 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-12-12 20:35:16 +0000
commitb0422b215c100bb29c1071872012a1f3c6681058 (patch)
treea764deb63dc546abe6c0b283feac110fd22d01c4 /doc/src
parentff7349694f399d0063b51419ea6e25770334f363 (diff)
downloadpostgresql-b0422b215c100bb29c1071872012a1f3c6681058.tar.gz
postgresql-b0422b215c100bb29c1071872012a1f3c6681058.zip
Preliminary code review for domain CHECK constraints patch: add documentation,
make VALUE a non-reserved word again, use less invasive method of passing ConstraintTestValue into transformExpr, fix problems with nested constraint testing, do correct thing with NULL result from a constraint expression, remove memory leak. Domain checks still need much more work if we are going to allow ALTER DOMAIN, however.
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/ref/create_domain.sgml23
-rw-r--r--doc/src/sgml/release.sgml3
2 files changed, 23 insertions, 3 deletions
diff --git a/doc/src/sgml/ref/create_domain.sgml b/doc/src/sgml/ref/create_domain.sgml
index 488f86811c7..0d44434b3e5 100644
--- a/doc/src/sgml/ref/create_domain.sgml
+++ b/doc/src/sgml/ref/create_domain.sgml
@@ -1,5 +1,5 @@
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_domain.sgml,v 1.8 2002/11/21 23:34:43 petere Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_domain.sgml,v 1.9 2002/12/12 20:35:07 tgl Exp $
PostgreSQL documentation
-->
@@ -30,7 +30,7 @@ CREATE DOMAIN <replaceable class="parameter">domainname</replaceable> [AS] <repl
where <replaceable class="PARAMETER">constraint</replaceable> is:
[ CONSTRAINT <replaceable class="PARAMETER">constraint_name</replaceable> ]
-{ NOT NULL | NULL }
+{ NOT NULL | NULL | CHECK (<replaceable class="PARAMETER">expression</replaceable>) }
</synopsis>
<refsect2 id="R2-SQL-CREATEDOMAIN-1">
@@ -128,6 +128,25 @@ where <replaceable class="PARAMETER">constraint</replaceable> is:
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><literal>CHECK (<replaceable class="PARAMETER">expression</replaceable>)</literal></term>
+ <listitem>
+ <para>
+ <literal>CHECK</> clauses specify integrity constraints or tests
+ which values of the domain must satisfy.
+ Each constraint must be an expression
+ producing a Boolean result. It should use the name <literal>VALUE</>
+ to refer to the value being tested.
+ </para>
+
+ <para>
+ Currently, <literal>CHECK</literal> expressions cannot contain
+ subselects nor refer to variables other than <literal>VALUE</>.
+ </para>
+
+ </listitem>
+ </varlistentry>
+
</variablelist>
</para>
</refsect2>
diff --git a/doc/src/sgml/release.sgml b/doc/src/sgml/release.sgml
index b43db923e21..ce54952e02a 100644
--- a/doc/src/sgml/release.sgml
+++ b/doc/src/sgml/release.sgml
@@ -1,5 +1,5 @@
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/release.sgml,v 1.168 2002/11/26 22:04:03 momjian Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/release.sgml,v 1.169 2002/12/12 20:35:07 tgl Exp $
-->
<appendix id="release">
@@ -24,6 +24,7 @@ CDATA means the content is "SGML-free", so you can write without
worries about funny characters.
-->
<literallayout><![CDATA[
+Domains now support CHECK constraints
]]></literallayout>
</sect1>