Re: Per-column collation, proof of concept

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Jaime Casanova <jaime(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Per-column collation, proof of concept
Date: 2010-08-17 03:56:02
Message-ID: 1282017362.10562.4.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On lör, 2010-08-14 at 02:05 -0500, Jaime Casanova wrote:
> btw, the patch no longer apply cleanly but most are just hunks the
> worst it's in src/backend/catalog/namespace.c because
> FindConversionByName() is now called get_conversion_oid()... so maybe
> this function should be named get_collation_oid(), i guess

OK, that will need to be adjusted.

> well at least pg_collation should be a shared catalog, no?
> and i think we shouldn't be thinking in this without think first how
> to integrate this with at least per-database configuration

Good point. But one might also want to create "private" collations, so
a collation in a schema would also be useful. Tricky.

> also, it doesn't recognize C collate although it is in the locales.txt
> """
> test3=# create database test4 with template=template0 encoding 'utf-8'
> lc_collate='C';
> CREATE DATABASE
> test3=# create table t3 (col1 text collate "C" );
> ERROR: collation "C" does not exist
> """

I've fixed this in the meantime. Your version of the patch doesn't
support the C locale yet.

> BTW, why the double quotes?

Because the name contains upper case letters?

> sorry to state the obvious but this doesn't work on windows, does it?

Probably not, but hopefully there is some similar API that could be used
on Windows.

> and for some reason it also didn't work on a centos 5 (this error
> ocurred when initdb'ing)
> """
> loading system objects' descriptions ... ok
> creating collations ...FATAL: invalid byte sequence for encoding
> "UTF8": 0xe56c09
> CONTEXT: COPY tmp_pg_collation, line 86
> STATEMENT: COPY tmp_pg_collation FROM
> E'/usr/local/pgsql/9.1/share/locales.txt';
> """

Hmm, what is in that file on that line?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message KaiGai Kohei 2010-08-17 04:00:02 Re: security label support, part.2
Previous Message KaiGai Kohei 2010-08-17 03:43:09 Re: shared_preload_libraries is ignored in single user mode