Skip site navigation (1) Skip section navigation (2)

Re: The syntax about CREATE DOMAIN

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Gary WAN <wan_on(at)hotmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: The syntax about CREATE DOMAIN
Date: 2004-02-27 05:25:49
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
On Tue, 24 Feb 2004, Gary WAN wrote:

> Dear Sir,
>   I would like to tell you that the SQL about "Create Domain" is still
> cannot involve constraints other than NULL | NOT NULL in Postgresql 7.4.1.
>   For instances, when I type the following sentences, it shows error
> message:
>   Create Domain GenderDomain CHAR(1) Constraint g Check Value in ('M','F');
>   Error: syntax error at or new "VALUE" at character ...
>   How can I obtain the correct syntax about domain in postgresql?

sszabo=# \h create domain
Command:     CREATE DOMAIN
Description: define a new domain
CREATE DOMAIN name [AS] data_type
    [ DEFAULT expression ]
    [ constraint [ ... ] ]

where constraint is:

[ CONSTRAINT constraint_name ]
{ NOT NULL | NULL | CHECK (expression) }

Note the parentheses around the check expression.

In response to

pgsql-bugs by date

Next:From: Tom LaneDate: 2004-02-27 05:42:59
Subject: Re: The syntax about CREATE DOMAIN
Previous:From: Daniel O'NeillDate: 2004-02-27 00:42:52
Subject: Optimizer problem with subselect.c?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group