Re: unexpected check constraint violation - Mailing list pgsql-general

From Jacek Becla
Subject Re: unexpected check constraint violation
Date
Msg-id 49C7F6A2.8030605@SLAC.Stanford.EDU
Whole thread Raw
In response to Re: unexpected check constraint violation  (ries van Twisk <pg@rvt.dds.nl>)
Responses Re: unexpected check constraint violation
List pgsql-general
Thanks Ries. Do you know if that is a postgres feature or a bug?

In practice, I wanted to load the data from a file using
COPY FROM. Modifying a large csv file in impractical and
not very elegant.

thanks,
Jacek



ries van Twisk wrote:
>
> On Mar 23, 2009, at 2:54 PM, Jacek Becla 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"
>>
>> thanks
>> Jacek
>
>
> try this:
>
> insert into t values (0.00603::real);
>
> Ries
>
>
>
>


pgsql-general by date:

Previous
From: RebeccaJ
Date:
Subject: Re: text column constraint, newbie question
Next
From: Scott Marlowe
Date:
Subject: Re: unexpected check constraint violation