Re: Per-column collation, the finale

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Thom Brown <thom(at)linux(dot)com>
Cc: Noah Misch <noah(at)leadboat(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Per-column collation, the finale
Date: 2011-02-09 16:53:43
Message-ID: 1297270423.23596.3.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On tis, 2011-02-08 at 22:17 +0000, Thom Brown wrote:
> postgres=# create table meow (id serial, stuff text collate "de_XX");
> NOTICE: CREATE TABLE will create implicit sequence "meow_id_seq" for
> serial column "meow.id"
> ERROR: collation "de_XX" for current database encoding "UTF8" does not exist
> LINE 1: create table meow (id serial, stuff text collate "de_XX");
>
> I wouldn't expect to see that first notice. Shouldn't that step come
> a bit later?

This isn't much different from writing

create table meow (id serial, stuff nonsense);

You'll still get the notice before it errors out on type-not-found.

> A bit of weirdness, I'm allowed to specify more than one collation on
> a single column ordering...

> Is this the same principal as casting, where they can be chained?
> Which one wins in this case?

Yeah, last one wins.

> Also, if a locale is installed after initdb, is it then impossible to
> get pg_collate to pick up that new locale?

Currently, you can insert it yourself into pg_collation. I have a
CREATE COLLATION patch in the works.

> If a locale is somehow
> removed from the system, what happens on the database side when
> attempting to use a collated column?

Then you're hosed, but that has always been the case, with per-cluster
and per-database locales.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-02-09 17:20:06 Re: Sync Rep for 2011CF1
Previous Message Magnus Hagander 2011-02-09 16:14:20 Re: [COMMITTERS] pgsql: Remove more SGML tabs.