Re: What's a good default encoding?

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Vivek Khera <vivek(at)khera(dot)org>
Cc: pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: Re: What's a good default encoding?
Date: 2006-03-21 11:50:25
Message-ID: 20060321115025.GA11045@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Mar 20, 2006 at 06:07:16PM -0500, Vivek Khera wrote:
> So, if I use a UTF8 encoded DB on FreeBSD, all hell will break loose
> or what? Will things not compare correctly? Where from does the
> code to do the collating come, then?

It just won't collate properly. PostgreSQL collation is provided by the
underlying C library via strcoll(). FreeBSD simply doesn't support
UTF-8 collation. IIRC the UTF-8 collation code simply uses the ASCII
collation. It's an order, just not the order most people will be
expecting.

If you look at the collation code in FreeBSD you'll see it doesn't work
for any multibyte encoding. That's OK, it's obviously not important to
FreeBSD users.

But I'm ademantly against building and maintaining a special UTF-8
collation library just for PostgreSQL. That's just reinventing the
wheel. There already exist cross-platform libraries to handle collation
and we should work towards allowing people to use one of those...

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Terry Lee Tucker 2006-03-21 11:56:23 Order of Update - Second Try
Previous Message Qingqing Zhou 2006-03-21 09:35:46 Re: PANIC: heap_update_redo: no block