Re: Is there a reason why Postgres doesn't have Byte or tinyint? - Mailing list pgsql-general

From Darren Duncan
Subject Re: Is there a reason why Postgres doesn't have Byte or tinyint?
Date
Msg-id 4F094450.7000102@darrenduncan.net
Whole thread Raw
In response to Is there a reason why Postgres doesn't have Byte or tinyint?  (Mike Christensen <mike@kitchenpc.com>)
Responses Re: Is there a reason why Postgres doesn't have Byte or tinyint?  (Mike Christensen <mike@kitchenpc.com>)
List pgsql-general
Mike Christensen wrote:
> According to the manuals, Postgres has smallint (2 byte), integer (4
> bytes) and bigint (8 bytes)..  I use a lot of structures with "bytes"
> in my code and it's kinda annoying to cast DB output from Int16 to
> Byte every time, especially since there's no explicit cast in .NET and
> you have to use System.Convert().
>
> Is there a work-around, or do people just cast or use Int16 in their
> data structures?  Just wondering..  I know on modern computers it
> probably doesn't make any difference anyway..

Is this just about programmer convenience or is it about space efficiency in the
database?  BYTEA might help you.  Or try declaring a DOMAIN over SMALLINT that
limits allowed values to the range of a byte. -- Darren Duncan

pgsql-general by date:

Previous
From: Mike Christensen
Date:
Subject: Is there a reason why Postgres doesn't have Byte or tinyint?
Next
From: Mike Christensen
Date:
Subject: Re: Is there a reason why Postgres doesn't have Byte or tinyint?