678
678
The CHECK constraint specifies a rule that a group of one or
679
679
more columns of a table may contain only those values allowed by
680
680
the rule.
681
- </para>
682
- <PARA>
683
681
The CHECK constraint is either a table constraint or a column
684
682
constraint.
685
683
</PARA>
686
684
<PARA>
687
685
PostgreSQL automatically creates an unique index to assure
688
- data integrity. (See CREATE INDEX statement)
689
- </PARA>
690
- <PARA>
686
+ data integrity (See CREATE INDEX statement).
691
687
The SQL92 CHECK column constraints can only be defined on, and
692
688
refer to, one column of the table. PostgreSQL does not have
693
689
this restriction.
694
690
</PARA>
695
691
</refsect3>
696
- <refsect3>
697
- <title>BUGS in CHECK constraint</title>
698
- <PARA>
699
- The following CHECK constraints gives a parse error like:
700
- <programlisting>
701
- ERROR: parser: parse error at or near "opname":
702
- </programlisting>
703
- <simplelist columns="1">
704
- <member>CHECK ( <replaceable class="parameter">column</replaceable> BETWEEN 'A' AND 'Z' )</member>
705
- <member>CHECK ( <replaceable class="parameter">column</replaceable> IN ('A','Z'))</member>
706
- <member>CHECK ( <replaceable class="parameter">column</replaceable> NOT LIKE 'A%')</member>
707
- </simplelist>
708
- </para>
709
- </refsect3>
710
692
</REFSECT2>
711
693
712
694
<REFSECT2 ID="R2-SQL-PRIMARYKEY-1">
1015
997
</programlisting>
1016
998
<para>
1017
999
Temporary tables are not currently available in <productname>Postgres</productname>.
1000
+ <tip>
1018
1001
<para>
1019
- TIP: In the current release of <productname>Postgres</productname> (v6.3.2 ), to create a temporary
1002
+ In the current release of <productname>Postgres</productname> (v6.4 ), to create a temporary
1020
1003
table you must create and drop the table by explicit commands.
1021
- </para >
1004
+ </tip >
1022
1005
1023
1006
<REFSECT3 ID="R3-SQL-UNIQUECLAUSE-1">
1024
1007
<REFSECT3INFO>
@@ -1067,6 +1050,13 @@ Temporary tables are not currently available in <productname>Postgres</productna
1067
1050
</synopsis>
1068
1051
</REFSECT3>
1069
1052
1053
+ <!--
1054
+ I can't figure out why DEFAULT clause is different from what we already have.
1055
+ Perhaps because CURRENT_USER and CURRENT_DATE have specific types (currently
1056
+ the "name" type), if you aren't careful then the types won't match up with
1057
+ the column. Not our problem...
1058
+ - Thomas 1998-08-16
1059
+
1070
1060
<REFSECT3 ID="R3-SQL-DEFAULTCLAUSE-1">
1071
1061
<REFSECT3INFO>
1072
1062
<DATE>1998-04-15</DATE>
@@ -1080,12 +1070,12 @@ Temporary tables are not currently available in <productname>Postgres</productna
1080
1070
or a domain.
1081
1071
</para>
1082
1072
<synopsis>
1083
- DEFAULT <replaceable class="parameter">literal</replaceable> |
1084
- niladic USER function |
1085
- niladic datetime function |
1086
- NULL
1073
+ DEFAULT niladic USER function |
1074
+ niladic datetime function |
1075
+ NULL
1087
1076
</synopsis>
1088
1077
</refsect3>
1078
+ -->
1089
1079
1090
1080
<REFSECT3 ID="R3-SQL-CONSTRAINT-3">
1091
1081
<REFSECT3INFO>
@@ -1096,7 +1086,7 @@ Temporary tables are not currently available in <productname>Postgres</productna
1096
1086
</TITLE>
1097
1087
<PARA>
1098
1088
SQL92 specifies some additional capabilities for CONSTRAINTs,
1099
- it also defines assertions and domain constraints.
1089
+ and also defines assertions and domain constraints.
1100
1090
</PARA>
1101
1091
<PARA>
1102
1092
An assertion is a special type of integrity constraint and share
@@ -1209,12 +1199,19 @@ Temporary tables are not currently available in <productname>Postgres</productna
1209
1199
CHECK clause
1210
1200
</TITLE>
1211
1201
<PARA>
1212
- SQL92 specifies some additional capabilities for CHECK:
1202
+ SQL92 specifies some additional capabilities for CHECK in either
1203
+ table or column constraints.
1213
1204
</PARA>
1205
+ <!--
1206
+ Constraints associated with domains do not need to be mentioned here,
1207
+ even though it is the case that a domain constraint may possibly
1208
+ affect a column or a table.
1209
+ - Thomas 1998-08-16
1214
1210
<para>
1215
1211
A CHECK constraint is either a table constraint, a column
1216
1212
constraint or a domain constraint.
1217
1213
</para>
1214
+ -->
1218
1215
<para>
1219
1216
table constraint definition:
1220
1217
</para>
@@ -1233,6 +1230,7 @@ Temporary tables are not currently available in <productname>Postgres</productna
1233
1230
[ {INITIALLY DEFERRED | INITIALLY IMMEDIATE} ]
1234
1231
[ [ NOT ] DEFERRABLE ]
1235
1232
</synopsis>
1233
+ <!--
1236
1234
<para>
1237
1235
domain constraint definition:
1238
1236
</para>
@@ -1253,6 +1251,7 @@ Temporary tables are not currently available in <productname>Postgres</productna
1253
1251
ALTER DOMAIN cities
1254
1252
ADD CONSTRAINT new_city CHECK (VALUE LIKE 'L%');
1255
1253
</programlisting>
1254
+ -->
1256
1255
</refsect3>
1257
1256
1258
1257
0 commit comments