Skip site navigation (1) Skip section navigation (2)

WIP patch: Collation support

From: "Radek Strnad" <radek(dot)strnad(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org, "Radek Strnad" <radek(dot)strnad(at)gmail(dot)com>
Subject: WIP patch: Collation support
Date: 2008-08-31 21:32:30
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
I'm implementing collation support. Proposal can be found at

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?


Radek Strnad

Attachment: wip-collation.patch
Description: text/x-diff (79.9 KB)


pgsql-hackers by date

Next:From: Zdenek KotalaDate: 2008-08-31 21:44:02
Subject: Prototype: In-place upgrade
Previous:From: Simon RiggsDate: 2008-08-31 20:04:34
Subject: Re: [HACKERS] Infrastructure changes for recovery

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group