Re: unexpected check constraint violation

From: Jacek Becla <becla(at)slac(dot)stanford(dot)edu>
To: ries van Twisk <pg(at)rvt(dot)dds(dot)nl>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: unexpected check constraint violation
Date: 2009-03-23 20:52:50
Message-ID: 49C7F6A2.8030605@SLAC.Stanford.EDU
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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
>
>
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Whit Armstrong 2009-03-23 21:00:43 libpq -- reading a timestamp with time zone using binary format
Previous Message ries van Twisk 2009-03-23 20:49:13 Re: unexpected check constraint violation