Re: unsigned types - Mailing list pgsql-general

From Neil Conway
Subject Re: unsigned types
Date
Msg-id 1129413775.8219.34.camel@localhost.localdomain
Whole thread Raw
In response to unsigned types  (jeff sacksteder <jsacksteder@gmail.com>)
Responses Re: unsigned types  (jeff sacksteder <jsacksteder@gmail.com>)
List pgsql-general
On Sat, 2005-15-10 at 16:42 -0400, jeff sacksteder wrote:
> It occurs to me that I don't know how to define unsigned integer
> datatypes. I'm making a schema to describe network packets and I need
> columns to contain values from 0-255, etc.
>
> I can't seem to find any documentation on this. What's the best
> prectice for this situation?

You can use a signed type with a CHECK constraint to restrict the
column's value to positive integers.

-Neil



pgsql-general by date:

Previous
From: Michael Glaesemann
Date:
Subject: Re: unsigned types
Next
From: Peter Eisentraut
Date:
Subject: Re: PostgreSQL Gotchas