Re: [WIP] patch - Collation at database level

From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Gregory Stark <stark(at)enterprisedb(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Radek Strnad <radek(dot)strnad(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [WIP] patch - Collation at database level
Date: 2008-07-08 10:00:34
Message-ID: 48733AC2.5050404@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Martijn van Oosterhout napsal(a):
> On Tue, Jul 08, 2008 at 11:27:35AM +0200, Zdenek Kotala wrote:
>> Zdenek Kotala napsal(a):
>>
>>> I though more about it and I discussed it with Radek yesterday. The
>>> problem is that collation must be created before user want to use CREATE
>>> DATABASE ... COLLATE ... command. It inclines to have have pg_collation
>>> as a global catalog, but ANSI specifies to use schema name in collation
>>> specification and schemes are database specific ... It means that
>>> pg_collation have to be non-shared catalog and new database only
>>> inherits collation from template db. And CREATE DATABASE have to check
>>> list of collation in template database :(.
>> thinking more ...
>> It must be shared catalog because pg_database will depend on it.
>
> Not necessarily. pg_class is not shared yet without it you can't even
> find pg_database. Same deal with pg_type. All it means is that
> pg_collation in template1 must contain all the collations used in
> template1, which shouldn't be hard to arrange.

I think, Collation situation is different, becasue pg_database will contains
column colname. pg_class (and all bootstrap catalog) only contains row which
specify that shared table exists and content is cloned to the new database from
template database. In corner case you can get context specific dependency for
example if Czech collation will have oid=10 in database test01 and Swedish
collation will have oid=10 in database test02. How to handle CREATE DATABASE and
connect database? OK it shouldn't happen in normal situation but ...

Zdenek

--
Zdenek Kotala Sun Microsystems
Prague, Czech Republic http://sun.com/postgresql

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Martijn van Oosterhout 2008-07-08 10:19:18 Re: [WIP] patch - Collation at database level
Previous Message Martijn van Oosterhout 2008-07-08 09:49:52 Re: [WIP] patch - Collation at database level