Re: Can't specify default collation?

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Can't specify default collation?
Date: 2011-03-15 20:19:30
Message-ID: 1300220370.7581.34.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On tor, 2011-03-10 at 18:12 -0500, Tom Lane wrote:
> What I'm inclined to do about this is set "default"'s collencoding to
> -1, with the semantics of "works for any encoding", and fix the lookup
> routines to try -1 if they don't get a match with the database
> encoding. Having done that, we could also use -1 for "C" and "POSIX",
> thus avoiding having to make a bunch of duplicate entries for them.

Good idea.

> BTW, I would like to eventually have "C" and "POSIX" in there all the
> time (ie created by pg_collation.h), so that they can be used even in
> machines that don't have locale_t support. I haven't yet gotten
> around to reading the parts of the collation patch that might need to
> change to support this, so I'm not sure how much work it'd be. But
> I'd say that being able to do COLLATE "C" in an otherwise non-C
> database would cover a very large fraction of the user requests I've
> read about this, so being able to handle that case even without
> locale_t support would be really useful IMO.

That should actually already work. The relevant logic is in
varstr_cmp().

But good point. We should support this out of the box on all platforms.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2011-03-15 20:22:43 Re: FuncExpr.collid/OpExpr.collid unworkably serving double duty
Previous Message Tom Lane 2011-03-15 20:16:05 Re: FuncExpr.collid/OpExpr.collid unworkably serving double duty