X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id CAD6FD1B431 for ; Wed, 26 Nov 2003 11:11:25 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 24322-07 for ; Wed, 26 Nov 2003 07:10:57 -0400 (AST) Received: from sofia.digsys.bg (sofia.digsys.bg [193.68.3.250]) by svr1.postgresql.org (Postfix) with ESMTP id B5320D1B42F for ; Wed, 26 Nov 2003 07:10:38 -0400 (AST) Received: from faith.digsys.bg (root@faith.digsys.bg [193.68.13.10]) by sofia.digsys.bg (8.11.6/8.10.1) with ESMTP id hAQBAVB14448 for ; Wed, 26 Nov 2003 13:10:32 +0200 (EET) Received: from faith.digsys.bg (kaloyan@sigma.digsys.bg [193.68.13.25]) by faith.digsys.bg (8.12.9/8.12.9) with ESMTP id hAQBAUAK029768 for ; Wed, 26 Nov 2003 13:10:30 +0200 (EET) Message-ID: <3FC48A26.1090407@faith.digsys.bg> Date: Wed, 26 Nov 2003 13:10:30 +0200 From: Kaloyan Iliev Iliev User-Agent: Mozilla/5.0 (X11; U; BSD/OS i386; en-US; rv:1.3) Gecko/20030327 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Unsigned numbers Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/287 X-Sequence-Number: 16102 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!