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

Commit 6c3561b

Browse files
committed
Minor editorialization on example --- I think that the use of dollar
quoting in this case is just needless obscurantism.
1 parent ff9d69d commit 6c3561b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

doc/src/sgml/ref/create_domain.sgml

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/create_domain.sgml,v 1.18 2004/08/08 01:49:30 momjian Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/create_domain.sgml,v 1.19 2004/08/08 02:05:32 tgl Exp $
33
PostgreSQL documentation
44
-->
55

@@ -161,14 +161,14 @@ where <replaceable class="PARAMETER">constraint</replaceable> is:
161161

162162
<para>
163163
This example creates the <type>us_postal_code</type> data type and
164-
then uses the type in a table definition:
164+
then uses the type in a table definition. A regular expression test
165+
is used to verify that the value looks like a valid US postal code.
165166

166167
<programlisting>
167168
CREATE DOMAIN us_postal_code AS TEXT
168-
NOT NULL
169169
CHECK(
170-
VALUE ~ $pc$^\d{5}$$pc$
171-
OR VALUE ~ $pc$^\d{5}-\d{4}$$pc$
170+
VALUE ~ '^\d{5}$'
171+
OR VALUE ~ '^\d{5}-\d{4}$'
172172
);
173173

174174
CREATE TABLE us_snail_addy (
@@ -177,7 +177,7 @@ CREATE TABLE us_snail_addy (
177177
, street2 TEXT
178178
, street3 TEXT
179179
, city TEXT NOT NULL
180-
, postal us_postal_code
180+
, postal us_postal_code NOT NULL
181181
);
182182
</programlisting>
183183
</para>

0 commit comments

Comments
 (0)