Re: Fixed length data types issue - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Fixed length data types issue
Date
Msg-id 200609141735.k8EHZEx27517@momjian.us
Whole thread Raw
In response to Re: Fixed length data types issue  (Bruce Momjian <bruce@momjian.us>)
Responses Re: Fixed length data types issue  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-hackers
Bruce Momjian wrote:
> Gregory Stark wrote:
> > 
> > Alvaro Herrera <alvherre@commandprompt.com> writes:
> > 
> > > Gregory Stark wrote:
> > >> 
> > >> Well "char" doesn't have quite the same semantics as CHAR(1). If that's the
> > >> consensus though then I can work on either fixing "char" semantics to match
> > >> CHAR(1) or adding a separate type instead.
> > >
> > > What semantics?  
> > 
> > The main bit that comes to mind is 32::CHAR(1) give you '3' but 32::"char"
> > gives you ' '.
> > 
> > Really it makes more sense if you think of "char" is a 1 byte integer type
> > with some extra text casts and operators to make C programmers happy, not a 1
> > byte character type.
> 
> One very nifty trick would be to fix "char" to act as CHAR(), and map
> CHAR(1) automatically to "char".

Sorry, probably a stupid idea considering multi-byte encodings.  I
suppose it could be an optimization for single-byte encodings, but that
seems very limiting.

--  Bruce Momjian   bruce@momjian.us EnterpriseDB    http://www.enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: New version of money type
Next
From: "D'Arcy J.M. Cain"
Date:
Subject: Re: New version of money type