pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kaloyan Iliev Iliev <news1@faith.digsys.bg>
To: pgsql-sql@postgresql.org
Subject: Unsigned numbers
Date: Wed, 26 Nov 2003 13:10:30 +0200
Message-ID: <3FC48A26.1090407@faith.digsys.bg> (raw)

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!




view thread (4+ messages)  latest in thread

Message-ID: <3FC48A26.1090407@faith.digsys.bg>
Permalink:  ../3FC48A26.1090407@faith.digsys.bg/
Also on:    postgresql.org/message-id/3FC48A26.1090407@faith.digsys.bg

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: news1@faith.digsys.bg
  Subject: Re: Unsigned numbers
  In-Reply-To: <3FC48A26.1090407@faith.digsys.bg>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox