Re: [HACKERS] Re: [PATCHES] char/varchar locale support - Mailing list pgsql-hackers

From Michal Mosiewicz
Subject Re: [HACKERS] Re: [PATCHES] char/varchar locale support
Date
Msg-id 35606363.3884309@interdata.com.pl
Whole thread Raw
In response to Re: [HACKERS] Re: [PATCHES] char/varchar locale support  (Oleg Broytmann <phd@comus.ru>)
List pgsql-hackers
Thomas G. Lockhart wrote:

> btw, if we do implement NATIONAL CHARACTER I would like to do so by
> having it fit in with the full SQL92 character sets and collating
> sequences capabilities. Then one could specify what NATIONAL CHAR means
> for an installation or perhaps at run time without having to
> recompile...

I fully agree that there should be a CREATE COLLATION syntax or similiar
with ability to add collation keyword in every place that needs a
character comparision, like btree indexes, orders, or simply comparision
operators.

This mean that we should start probably from creating three-parameter
comparision functions with added a third parameter to select collation.

Additionally, it's worth to note that using strcoll is highly expensive.
I've got some reports from people who used postgreSQL with national
characters and noticed performance drop-downs up to 20 times (Linux). So
it's needed to create a cheap comparision functions that will preserve
it's translation tables during sessions.

Anyhow, if anybody wants to try inefficient strcoll, long time ago I've
sent a patch to sort chars/varchars using it. But I don't recommend it.

Mike

--
WWW: http://www.lodz.pdi.net/~mimo  tel: Int. Acc. Code + 48 42 148340
add: Michal Mosiewicz  *  Bugaj 66 m.54 *  95-200 Pabianice  *  POLAND

pgsql-hackers by date:

Previous
From: Brett McCormick
Date:
Subject: Re: [HACKERS] Re: [PATCHES] char/varchar locale support
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Query cancel and OOB data