[WIP] collation support revisited (phase 1) - Mailing list pgsql-hackers

From Radek Strnad
Subject [WIP] collation support revisited (phase 1)
Date
Msg-id de5165440807101424l14fb535byf43fc665351c4dfd@mail.gmail.com
Whole thread Raw
Responses Re: [WIP] collation support revisited (phase 1)  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-hackers
Hi,<br /><br />after long discussion with Mr. Kotala, we've decided to redesign our collation support proposal.<br
/>Forthose of you who aren't familiar with my WIP patch and comments from other hackers here's the original mail: <a
href="http://archives.postgresql.org/pgsql-hackers/2008-07/msg00019.php">http://archives.postgresql.org/pgsql-hackers/2008-07/msg00019.php</a><br
/><br/>In a few sentences - I'm writing collation support for PostgreSQL that is almost independent on used collating
function.I will implement POSIX locales but switch to ICU will be quite easy. Collations and character sets defined by
SQLstandard will be hard coded so we avoid non-existence in some functions.<br /><br />The whole project will be
dividedinto two phases:<br /><br />phase 1<br />Implement "sort of framework" so the PostgreSQL will have basic guts
(pg_collation& pg_charset catalogs, CREATE COLLATION, add collation support for each type needed) and will support
collationat database level. This phase has been accepted as a Google Summer of Code project.<br /><br />phase 2<br
/>Implementthe rest - full collation at column level. I will continue working on this after finishing phase one and it
willbe my master degree thesis.<br /><br />How will the first part work?<br /><br />Catalogs<br /> - new catalogs
pg_collationand pg_charset will be defined<br />- pg_collation and pg_charset will contain SQL standard collations +
optionaldefault collation (when set other than SQL standard one)<br />- pg_type, pg_attribute, pg_namespace will be
extendedwith references to default records in pg_collation and pg_charset<br /><br />initdb<br />- pg_collation &
pg_charsetwill contain each pre-defined records regarding SQL standard and optionally one record that will be
non-standardset when creating initdb (the one using system locales) <br />- these two records will be referenced by
pg_type,pg_attribute, pg_namespace in concerned columns and will be concidered as default collation that will be
inherited<br/><br />CREATE DATABASE ... COLLATE ...<br />- after copying the new database the collation will be default
(sameas cluster collation) or changed by COLLATE statement. Then we update pg_type, pg_attribute and pg_namespace
catalogs<br/> - reindex database<br /><br />When changing databases the database collation will be retrieved from type
textfrom pg_type. This part should be the only one that will be deleted when proceeding with phase 2. But that will
takea while :-)<br /><br />Thanks for all your comments<br /><br />    Regards<br /><br />        Radek Strnad<br /><br
/>

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: gsoc, text search selectivity and dllist enhancments
Next
From: Michelle Caisse
Date:
Subject: Re: Generating code coverage reports