Re: check (constraint) on point data type?

От: Jim Adams
Тема: Re: check (constraint) on point data type?
Дата: ,
Msg-id: 008101c7ce32$9711c7c0$6501a8c0@CAPTDRAKE
(см: обсуждение, исходный текст)
Ответ на: check (constraint) on point data type?  ("Jill")
Список: pgsql-novice

Скрыть дерево обсуждения

check (constraint) on point data type?  ("Jill", )
 Re: check (constraint) on point data type?  ("Jim Adams", )
 Re: check (constraint) on point data type?  (Michael Glaesemann, )
  Re: check (constraint) on point data type?  (Jim Nasby, )
   Re: check (constraint) on point data type?  (Michael Glaesemann, )
 Re: check (constraint) on point data type?  ("Jill", )
  Re: check (constraint) on point data type?  (Michael Glaesemann, )

Could it be due to the comma in your CHECK statement instead of a decimal?

 

-----Original Message-----
From: [mailto:] On Behalf Of Jill
Sent: Tuesday, July 24, 2007 2:59 PM
To:
Subject: [NOVICE] check (constraint) on point data type?

 

Hi,

I'd like to limit the values that can be added to a field.

The field is of type 'point', and I'd like it to reject any values less than 0 or bigger than 1 (i.e., accept only points with values like (0.4, 0.26)).

Let's say I try to define the upper boundary by doing:

ALTER TABLE "public"."locations"  ADD CONSTRAINT "up_boundary_chk" CHECK (location < (1,1));

 

but it fails.

What am I doing wrong?

I'm using Postgres 8.2.4.1

Thanks!

Jill

 


В списке pgsql-novice по дате сообщения:

От: Michael Glaesemann
Дата:
Сообщение: Re: check (constraint) on point data type?
От: "Jill"
Дата:
Сообщение: Re: check (constraint) on point data type?