Re: Per-column collation, the finale - Mailing list pgsql-hackers

From Thom Brown
Subject Re: Per-column collation, the finale
Date
Msg-id AANLkTin0wzbrO-uzWRFeSdzwWPXO9EUWCM0wY3BMmtxb@mail.gmail.com
Whole thread Raw
In response to Re: Per-column collation, the finale  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Per-column collation, the finale  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
On 8 February 2011 21:08, Peter Eisentraut <peter_e@gmx.net> wrote:
> On tor, 2011-02-03 at 18:36 -0500, Noah Misch wrote:
>> Looks good and tests well.  I've attached the same benchmark script
>> with updated timings, and I've marked the patch Ready for Committer.
>
> Committed.  Thanks everyone.

Awesome work Peter.  Few questions:

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?

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

postgres=# select * from meow order by stuff collate "en_GB" collate
"de_DE" desc;id | stuff
----+------- 2 | meow2 1 | meow
(2 rows)

Is this the same principal as casting, where they can be chained?
Which one wins in this case?  Although if anyone is actually doing
this, then it's just silly anyway. (says Thom having just done it)

Also, if a locale is installed after initdb, is it then impossible to
get pg_collate to pick up that new locale?  If a locale is somehow
removed from the system, what happens on the database side when
attempting to use a collated column? (I don't wish to TIAS on my own
system)

--
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935


pgsql-hackers by date:

Previous
From: Dimitri Fontaine
Date:
Subject: Re: Extensions versus pg_upgrade
Next
From: Jan Urbański
Date:
Subject: Re: REVIEW: PL/Python table functions