From: Richard Huxton <dev@archonet.com>
To: Kaloyan Iliev Iliev <news1@faith.digsys.bg>
To: pgsql-sql@postgresql.org
Subject: Re: Unsigned numbers
Date: Wed, 26 Nov 2003 11:46:08 +0000
Message-ID: <200311261146.08737.dev@archonet.com> (raw)
In-Reply-To: <3FC48A26.1090407@faith.digsys.bg>
References: <3FC48A26.1090407@faith.digsys.bg>
On Wednesday 26 November 2003 11:10, Kaloyan Iliev Iliev wrote:
> 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.
[snip - problem is that errors give constraint name]
> 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.
Adding CHECKs to domains is new for 7.4, I believe. There aren't any built-in
unsigned types, although in theory you could write your own.
What I do is format my constraint names in a known way. So, a check on table
foo, column bar might be called "foo_bar_positive" - then I can get the
information I want from the constraint name.
--
Richard Huxton
Archonet Ltd
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: dev@archonet.com, news1@faith.digsys.bg
Subject: Re: Unsigned numbers
In-Reply-To: <200311261146.08737.dev@archonet.com>
* 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