Re: Fixed length data types issue

From: Gregory Stark <gsstark(at)mit(dot)edu>
To: Gregory Stark <gsstark(at)MIT(dot)EDU>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Gregory Stark <gsstark(at)mit(dot)edu>, Bruce Momjian <bruce(at)momjian(dot)us>, pgsql-hackers(at)postgresql(dot)org, Martijn van Oosterhout <kleptog(at)svana(dot)org>
Subject: Re: Fixed length data types issue
Date: 2006-09-08 07:58:47
Message-ID: 874pviyeko.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Gregory Stark <gsstark(at)MIT(dot)EDU> writes:

> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
>
> > Gregory Stark wrote:
> > > > But that won't help in the example you posted upthread, because
> > > > char(N) is not fixed-length.
> > >
> > > Sure it is because any sane database--certainly any sane database
> > > using char(N)--is in C locale anyways.
> >
> > This matter is completely independent of the choice of locale and
> > therefore any unilateral redefinition of sanity that you might come up
> > with.
>
> Except it isn't. If you're dealing with fixed length ascii codes from existing
> databases you interoperate with then you will have problems if you initialize
> your database in a non-C locale. Interpreting those codes in your locale will
> be do incorrect things like treat them as case insensitive or ignore spaces in
> collation, etc.

Oh, I think I misread your comment. You're saying the choice of encoding is
independent of the choice of locale.

Sure, if you're using UTF8 then how efficiently Postgres stores fixed length
data types isn't terribly relevant to you. Just as it isn't relevant if you're
storing other variable length data types.

But why would you use UTF8 to encode fixed length ascii strings?

--
greg

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2006-09-08 09:38:27 Re: A note about buildfarm ecpg-check
Previous Message Gregory Stark 2006-09-08 07:47:59 Re: Fixed length data types issue