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 E74AED1DC04 for ; Tue, 25 Nov 2003 11:11:39 +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 03107-09 for ; Tue, 25 Nov 2003 07:11:11 -0400 (AST) Received: from sofia.digsys.bg (sofia.digsys.bg [193.68.3.250]) by svr1.postgresql.org (Postfix) with ESMTP id C8CF7D1D92C for ; Tue, 25 Nov 2003 07:11:05 -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 hAPBB4B24542 for ; Tue, 25 Nov 2003 13:11:04 +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 hAPBB4AK004620 for ; Tue, 25 Nov 2003 13:11:04 +0200 (EET) Message-ID: <3FC338C7.9070009@faith.digsys.bg> Date: Tue, 25 Nov 2003 13:11:03 +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-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests=USER_AGENT_MOZILLA_UA X-Spam-Level: X-Archive-Number: 200311/325 X-Sequence-Number: 16141 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!