The example given in create domain seems to be broken. ISTM it requires some
extra escaping to be usable (at least in my goings on today it sure was, and
I the entries in pg_constraint sure seem to indicate this as well). I
suggest that the examples should be updated as per the following patch.
Oh.. and Andrew @ Supernews had nothing to do with this ;-)
--
Robert Treat
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL
Index: create_domain.sgml
===================================================================
RCS file: /projects/cvsroot/pgsql/doc/src/sgml/ref/create_domain.sgml,v
retrieving revision 1.20
diff -c -r1.20 create_domain.sgml
*** create_domain.sgml 4 Jan 2005 00:39:53 -0000 1.20
--- create_domain.sgml 30 Apr 2005 22:06:33 -0000
***************
*** 167,174 ****
<programlisting>
CREATE DOMAIN us_postal_code AS TEXT
CHECK(
! VALUE ~ '^\d{5}$'
! OR VALUE ~ '^\d{5}-\d{4}$'
);
CREATE TABLE us_snail_addy (
--- 167,174 ----
<programlisting>
CREATE DOMAIN us_postal_code AS TEXT
CHECK(
! VALUE ~ '^\\d{5}$'
! OR VALUE ~ '^\\d{5}-\\d{4}$'
);
CREATE TABLE us_snail_addy (
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq