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

Re: [PATCHES] Patch for database locale settings

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alexey Slynko <slynko(at)tronet(dot)ru>, pgsql-hackers(at)postgresql(dot)org,pgsql-patches(at)postgresql(dot)org
Subject: Re: [PATCHES] Patch for database locale settings
Date: 2005-03-28 17:11:34
Message-ID: 20050328171134.GA28244@dcc.uchile.cl (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
On Mon, Mar 28, 2005 at 10:54:16AM -0500, Tom Lane wrote:
> Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl> writes:
> > Maybe it would work if we forced indexes on shared relations to be
> > scanned using a fixed collation.
> 
> The shared relations only have indexes on name, oid, and integer:
> select distinct atttypid::regtype
> from pg_class c join pg_attribute a on c.oid = a.attrelid
> where relisshared and relkind = 'i';
> and name has non-locale-sensitive ordering rules anyway.  So that's
> not the big problem; we could probably get away with decreeing that
> name will always be that way and that shared relations can't have
> locale-dependent indexes.

This is good news.

> The big problem (and the reason why this idea has been shot down in
> the past) is that CREATE DATABASE can't change the locale from what it
> is in the template database unless it's prepared to reindex any locale-
> sensitive indexes in the non-shared part of the template database.
> Which would be a difficult undertaking seeing that we can't even connect
> to the copied database until after commit.

I don't see how this is a showstopper.  At creation time we may decree
that the database is "incomplete", and users can't normally connect to
it; we only allow that after a phase of correcting minor issues, such as
reindexing if necessary.  I recall Fabien Coelho wanted to do something
on this area too.

We could do this with a new column (say) datready in pg_database, set to
false by CreateDb(); at connection time this could be checked.  The
downside I see to this is that the bit has to be checked at each
connection start; not sure if this is exceedingly onerous.

-- 
Alvaro Herrera (<alvherre[(at)]dcc(dot)uchile(dot)cl>)
Licensee shall have no right to use the Licensed Software
for productive or commercial use. (Licencia de StarOffice 6.0 beta)

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2005-03-28 17:24:51
Subject: Re: [PATCHES] Patch for database locale settings
Previous:From: Josh BerkusDate: 2005-03-28 16:57:58
Subject: Re: Making oidvector and int2vector variable-length

pgsql-patches by date

Next:From: Tom LaneDate: 2005-03-28 17:24:51
Subject: Re: [PATCHES] Patch for database locale settings
Previous:From: Alexey SlynkoDate: 2005-03-28 16:28:04
Subject: Re: [PATCHES] Patch for database locale settings

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