Re: unsigned types

From: Neil Conway <neilc(at)samurai(dot)com>
To: jeff sacksteder <jsacksteder(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: unsigned types
Date: 2005-10-15 22:02:55
Message-ID: 1129413775.8219.34.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2005-10-15 22:19:11 Re: PostgreSQL Gotchas
Previous Message Michael Glaesemann 2005-10-15 21:50:50 Re: unsigned types