Re: [17] CREATE COLLATION default provider - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: [17] CREATE COLLATION default provider
Date
Msg-id 79893a79-ebc0-4898-bed8-4ee74fe93f90@eisentraut.org
Whole thread Raw
In response to [17] CREATE COLLATION default provider  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: [17] CREATE COLLATION default provider
List pgsql-hackers
On 15.06.23 06:47, Jeff Davis wrote:
> Currently, CREATE COLLATION always defaults the provider to libc.
> 
> The attached patch causes it to default to libc if LC_COLLATE/LC_CTYPE
> are specified, otherwise default to the current database default
> collation's provider.
> 
> That way, the provider choice at initdb time then becomes the default
> for "CREATE DATABASE ... TEMPLATE template0", which then becomes the
> default provider for "CREATE COLLATION (LOCALE='...')".

I like the general idea.  If the user has selected ICU overall, it could 
be sensible that certain commands default to ICU.

I wonder, however, how useful this would be in practice.  In most 
interesting cases, you need to know what the provider is to be able to 
spell out the locale name appropriately.  The cases where some overlap 
exists, like the common "ll_CC", are already preloaded, so won't 
actually need to be specified explicitly in many cases.

Also, I think the default should only flow one way, top-down:  The 
default provider of CREATE COLLATION is datlocprovider.  There shouldn't 
be a second, botton-up way, based on the other specified CREATE 
COLLATION parameters.  That's just too much logical zig-zag, IMO. 
Otherwise, if you extend this locally, why not also look at if 
"deterministic" or "rules" was specified, etc.



pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Re: Report planning memory in EXPLAIN ANALYZE
Next
From: Alvaro Herrera
Date:
Subject: Re: minor replication slot docs edits