WIP patch: Collation support - Mailing list pgsql-hackers

From Radek Strnad
Subject WIP patch: Collation support
Date
Msg-id de5165440808311432t5618efb5j2f7b3c0f62da8c01@mail.gmail.com
Whole thread Raw
Responses Re: WIP patch: Collation support  (Alvaro Herrera <alvherre@commandprompt.com>)
Re: WIP patch: Collation support  (Peter Eisentraut <peter_e@gmx.net>)
Re: WIP patch: Collation support  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
I'm implementing collation support. Proposal can be found at http://archives.postgresql.org/pgsql-hackers/2008-07/msg00557.php

Progress so far:
- created catalogs pg_collation a pg_charset which are filled with three standard collations
- initdb changes rows called "DEFAULT" in both catalogs during the bki bootstrap phase with current system LC_COLLATE and LC_CTYPE or those set by command line.
- new collations can be defined with command CREATE COLLATION <collation name> FOR <character set specification>  FROM <existing collation name> [STRCOLFN <fn name>]
[ <pad characteristic> ] [ <case sensitive> ] [ LCCOLLATE <lc_collate> ] [ LCCTYPE <lc_ctype> ]
- because of pg_collation and pg_charset are catalogs individual for each database, if you want to create a database with collation other than specified, create it in template1 and then create database
- when connecting to database, it retrieves locales from pg_database and sets them

Design & functionality changes left:
- move retrieveing collation from pg_database to pg_type
- get case sensitivity and pad characteristic working
- wrap locale setting and text comparison into functions that will be referenced from pg_collation as regproc (make the code nice)
- when creating database with different collation than database cluster, the database has to be reindexed. Any idea how to do it? Function ReindexDatabase works only when database is opened.
- minor tweaks & fixes

Ideas? Comments?

Regards

Radek Strnad
Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Cause of occasional buildfarm failures in sequence test
Next
From: Zdenek Kotala
Date:
Subject: Prototype: In-place upgrade