Re: Vague idea for allowing per-column locale

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tim Allen <tim(at)proximity(dot)com(dot)au>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Vague idea for allowing per-column locale
Date: 2001-08-10 15:24:13
Message-ID: Pine.LNX.4.30.0108101717040.703-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tim Allen writes:

> For converting, say, utf8 to euc-jp, it would be nice to be able to make
> use of all the existing infrastructure that PostgreSQL has for type
> conversion and type identification.

Unfortunately, that infrastructure is rather poorly suited for handling
arbitrary types.

> It'd be even nicer if you could make a table that has, say, one column
> utf8 (or utf32 even), one column euc-jp and one column shift-jis, so
> that you could cache format conversions.

This might be a nice thing to show off but I'm not sure about the
practical use. There's Unicode that you can use if you want to mix and
match on the server, and the ability to convert the character set between
client and server so the right thing shows up on everyone's screen.

> Under my grand plan one would have to implement comparison operators for
> each data type (as well as all the other things one has to implement for a
> data type);

You do realize that this would be hundreds, if not thousands, of things?

> BTW, how does postgres store multibyte text? As char * with a multibyte
> encoding?

Yes.

> As 16 bit or 32 bit code points? I should of course just look at
> the code and find out...:) I guess the former, from Peter's earlier
> comments. It does seem to me that using an explicit 32 bit representation
> (or at least providing that as an option) would make life easier in many
> ways.

I think the storage size penality would be prohibitive.

--
Peter Eisentraut peter_e(at)gmx(dot)net http://funkturm.homeip.net/~peter

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2001-08-10 15:35:39 Re: Vague idea for allowing per-column locale
Previous Message Bruce Momjian 2001-08-10 15:07:10 Re: contrib/postgis spatial extensions