Re: [WIP] patch - Collation at database level

Martijn van Oosterhout <kleptog@svana.org>

From: Martijn van Oosterhout <kleptog@svana.org>
To: Zdenek Kotala <Zdenek.Kotala@Sun.COM>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Gregory Stark <stark@enterprisedb.com>, Alvaro Herrera <alvherre@commandprompt.com>, Radek Strnad <radek.strnad@gmail.com>, pgsql-hackers@postgresql.org
Date: 2008-07-08T09:49:52Z
Lists: pgsql-hackers
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.

Have a nice day,
-- 
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while 
> boarding. Thank you for flying nlogn airlines.