Unsigned numbers

From: Kaloyan Iliev Iliev <kaloyan(at)faith(dot)digsys(dot)bg>
To: pgsql-sql(at)postgresql(dot)org
Subject: Unsigned numbers
Date: 2003-11-25 11:11:03
Message-ID: 3FC338C7.9070009@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!

Browse pgsql-sql by date

  From Date Subject
Next Message Kumar 2003-11-25 12:37:58 ::text problem
Previous Message vijaykumar M 2003-11-25 04:32:21 Re: how to read bytea contents by using pgsql scripts