Re: How to add locale support for each column?

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: How to add locale support for each column?
Date: 2004-09-19 19:22:57
Message-ID: 20040919121432.Y36412@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


On Sun, 19 Sep 2004, Greg Stark wrote:

>
> Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org> writes:
>
> > Still, we want the final solution to be what the sql standard specify. A
> > function as the proposed is however useful until a standard sql solution
> > is implemented. I've used a similar function for some projects and it have
> > worked well for me also.
>
> I haven't read the standard in this area (and the sections I have read don't
> lead me to think reading this section would be a trivial task), but from what
> I've seen people describe here I think the standard behaviour will be nigh
> useless anyway. From what I understand the standard has you declare a locale
> per column. That would mean the entire column can only store strings from a
> single locale.

AFAICT, it's one default collation per column, but you can specify a
collation to use on sorts and groups and comparisons.

I think example statement parts would be like:
ORDER BY name COLLATE de_DE
WHERE name COLLATE de_DE < 'Smith'
WHERE name < 'Smith' COLLATE de_DE

There are limitations, like I believe the following is an error
WHERE name COLLATE de_DE < 'Smith' COLLATE en_US
because both have different explicitly given collations.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-09-19 19:24:33 Re: How to add locale support for each column?
Previous Message Greg Stark 2004-09-19 19:02:28 Re: How to add locale support for each column?

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2004-09-19 19:24:33 Re: How to add locale support for each column?
Previous Message Michael Paesold 2004-09-19 19:13:42 Fix for VACUUM in psql autocommit off