Re: Problem with domains

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Problem with domains
Дата
Msg-id 20030924210459.H69610@megazone.bigpanda.com
обсуждение исходный текст
Ответ на Problem with domains  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: Problem with domains  (Robert Creager <Robert_Creager@LogicalChaos.org>)
Список pgsql-bugs
On Wed, 24 Sep 2003, Bruce Momjian wrote:

> Sent for user who is having trouble posting to bugs list:

Seems like the correct behavior to me. When CONSTRAINT is given, the
name is not optional AFAICS.

From SQL99:

<domain definition> ::=
CREATE DOMAIN <domain name> [ AS ] <data type>
[ <default clause> ]
[ <domain constraint>... ]
[ <collate clause> ]

<domain constraint> ::=
[ <constraint name definition> ]
<check constraint definition> [ <constraint characteristics> ]

<constraint name definition> ::=
CONSTRAINT <constraint name>

<check constraint definition> ::=
CHECK <left paren> <search condition> <right paren>

<constraint name> ::= <schema qualified name>

> > > > Using 7.4b2 from tar file, not cvs.
> > > >
> > > > PostgreSQL 7.4beta2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2.2
> > > > (Mandrake Linux 9.1 3.2.2-3mdk)
> > > >
> > > > While figuring out how to use DOMAIN's, I ran across this:
> > > >
> > > > begin;
> > > > create domain test as integer constraint check( value > 0 );
> > > > -- ERROR:  syntax error at or near "check" at character 42
> > > > create domain test as integer check( value > 0 );
> > > > -- ERROR:  current transaction is aborted, queries ignored until end of
> > > > transaction block
> > > >
> > > > Forgot to name the constraint in the first form.  The second form works fine
> > > > on it's own.

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Problem with domains
Следующее
От: Robert Creager
Дата:
Сообщение: Re: Problem with domains