On Mon, Mar 23, 2009 at 1:54 PM, Jacek Becla <be...@slac.stanford.edu> wrote:
> Hi,
>
> Can someone explain why postgres complains in this case:
>
> create table t(d real, check(d>=0.00603));
> insert into t values (0.00603);
>
> ERROR:  new row for relation "t" violates check constraint "t_d_check"

Without any casting, 0.00603 likely evaluates to a numeric.

select 0.00603::numeric > 0.00603::real;
 ?column?
----------
 t

So, this works:

 create table t(d real, check(d>=0.00603::real));
insert into t values (0.00603);
INSERT 0 1

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to