dbTalk Databases Forums  

[BUGS] The syntax about CREATE DOMAIN

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] The syntax about CREATE DOMAIN in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Gary WAN
 
Posts: n/a

Default [BUGS] The syntax about CREATE DOMAIN - 02-26-2004 , 07:45 PM






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?

Regards,
Gary

__________________________________________________ _______________
Get 10Mb extra storage for MSN Hotmail. Subscribe Now!
http://join.msn.com/?pgmarket=en-hk


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Reply With Quote
  #2  
Old   
Stephan Szabo
 
Posts: n/a

Default Re: [BUGS] The syntax about CREATE DOMAIN - 02-26-2004 , 11:28 PM






On Tue, 24 Feb 2004, Gary WAN wrote:

Quote:
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
Syntax:
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.

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster


Reply With Quote
  #3  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] The syntax about CREATE DOMAIN - 02-26-2004 , 11:49 PM



"Gary WAN" <wan_on (AT) hotmail (DOT) com> writes:
Quote:
Create Domain GenderDomain CHAR(1) Constraint g Check Value in ('M','F');
You need parentheses around the check expression. AFAICS this is per
spec.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.