strange behaviour of parser - numeric domain doesn't work phantom - Mailing list pgsql-hackers

From Pavel Stehule
Subject strange behaviour of parser - numeric domain doesn't work phantom
Date
Msg-id 162867790708130051i519bb900r36ff9bea632fa581@mail.gmail.com
Whole thread Raw
Responses Re: strange behaviour of parser - numeric domain doesn't work phantom  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hello

I am testing:

postgres=# create domain nb int check(value > 10);
CREATE DOMAIN
postgres=# select 11::nb;nb
----11
(1 row) -- ok

postgres=# select -11::nb;?column?
----------     -11
(1 row) -- ughh

postgres=# select (-11)::nb; -- I understand
ERROR:  value for domain nb violates check constraint "nb_check"

But nobody will write parentheses with alone negative number

Regards
Pavel Stehule

postgres=# select version();                                               version
-------------------------------------------------------------------------------------------------------PostgreSQL
8.3develon i686-pc-linux-gnu, compiled by GCC gcc (GCC)
 
4.1.2 20070502 (Red Hat 4.1.2-12)
(1 row)


pgsql-hackers by date:

Previous
From: Devrim GÜNDÜZ
Date:
Subject: Maximum row size
Next
From: Gregory Stark
Date:
Subject: Re: Maximum row size