Unsigned numbers

From: Kaloyan Iliev Iliev <news1(at)faith(dot)digsys(dot)bg>
To: pgsql-sql(at)postgresql(dot)org
Subject: Unsigned numbers
Date: 2003-11-26 11:10:30
Message-ID: 3FC48A26.1090407@faith.digsys.bg
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello Friends,

I have the following questions.
I have a lot of fields in my database that are int or float.
The problem is that I need them to be only positive (unsigned) and the
users try to insert sometimes negative.
I know that I can make this with CHECK CONSTRAINT but for some reasons
this is not a good solution for me. The reason is that when I have a
check constraint on a certain field and someone try to insert negative
number the error message contains the name of the constraint and the
name of the table but not the name of the field. So on higher level I
can't send a proper message to the user.

Are there any unsigned data types like unsigned int or unsigned float.
Can I make a domain or something like that (How exactly to add
constraint to domain).
I am using v7.3.2.
Thanks!

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Huxton 2003-11-26 11:46:08 Re: Unsigned numbers
Previous Message Kumar 2003-11-26 07:03:04 Re: ::text problem