Re: int1? - Mailing list pgsql-general

From Sean Chittenden
Subject Re: int1?
Date
Msg-id 20031009175453.GM86551@perrin.nxad.com
Whole thread Raw
In response to Re: int1?  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Responses Domains (was Re: int1?)  (Ron Johnson <ron.l.johnson@cox.net>)
Re: int1? types?  (CSN <cool_screen_name90001@yahoo.com>)
Re: int1?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
> > > Is there any date type that can be used for 0-255 values? Like
> > > an "int1" or byte column.
> >
> > A SMALLINT is two bytes on disk, use "char" instead.  This is a hidden
>
> However "char" has some serious deficiencies IIRC, such as the fact
> that there's no int<->"char" casts and it's standard I/O format is
> characters.  You can use ascii and chr to get around some of that,
> but it's ugly.

*nods* I have explicit casts everywhere when dealing with "char" and
it's far from being elegant or clean.

>
> > goodie in PostgreSQL and one that I wish was exposed via a more
> > conventional syntax (*hint hint*).
>
> If we were going to do that I think we'd be better off making a new
> type and leaving "char" alone.
>

You won't hear any disagreements from me on this one.  I've
sufficiently abused "char" as a 1 byte storage field and would love to
see an int1 or tinyint datatype added to cover this situation.  -sc

--
Sean Chittenden

pgsql-general by date:

Previous
From: Együd Csaba
Date:
Subject: Re: How to delete unclosed connections?
Next
From: "Dann Corbit"
Date:
Subject: Re: Response from MySql AB (Re: Humor me: Postgresql vs.