On Tue, Jul 08, 2008 at 09:05:11PM +0200, Zdenek Kotala wrote:
> >All the argument here is based on the premise that we should have
> >database-level collation specifications, which AFAICS is not required
> >nor suggested by the SQL spec.
>
> Yeah, it is not required, but by my opinion it should be derived from
> CREATE SCHEMA statement. There is following item:
>
> --- SQL ANSI 2003 page 520 ---
>
> 5) If <schema character set specification> is not specified, then a <schema
Careful, this is a 'character set specification" which has (almost)
nothing to do with collation. It's closer to the encoding field, which
is already in pg_database.
The issue with having a "default database collation" is that it's
unclear where it would be used. In the end the collation is defined by
the types and domains. Columns inherit from the types. I think the only
senseible definition is to decide that all the text/varchar/char types
inherit from the database. It's not in the spec but I think it does
make easier to decide what the default collation is. As an alternative
to:
ALTER TYPE text SET DEFAULT COLLATION TO foo;
<repeat for all other text types>
> I try to determine how to implement collation itself - collation catalog
> structure and content and how to create new collation. Column-level
> collation is nice but until we will not have basic infrastructure we cannot
> start implemented it.
I agree that this patch includes much basic work that needs to be done
for full collation support.
Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.