Re: Allow tailoring of ICU locales with custom rules

2023-03-08 Thread Peter Eisentraut
On 08.03.23 15:18, Laurenz Albe wrote: On Fri, 2023-03-03 at 13:45 +0100, Peter Eisentraut wrote: Ok, here is a version with an initdb option and also a createdb option (to expose the CREATE DATABASE option). You can mess with people by setting up your databases like this: initdb -D data --loc

Re: Allow tailoring of ICU locales with custom rules

2023-03-08 Thread Laurenz Albe
On Fri, 2023-03-03 at 13:45 +0100, Peter Eisentraut wrote: > Ok, here is a version with an initdb option and also a createdb option > (to expose the CREATE DATABASE option). > > You can mess with people by setting up your databases like this: > > initdb -D data --locale-provider=icu --icu-rules=

Re: Allow tailoring of ICU locales with custom rules

2023-03-08 Thread Laurenz Albe
On Tue, 2023-03-07 at 22:06 -0800, Jeff Davis wrote: > On Fri, 2023-03-03 at 13:45 +0100, Peter Eisentraut wrote: > > You can mess with people by setting up your databases like this: > > > > initdb -D data --locale-provider=icu --icu-rules='&a < c < b < e < d' > > > > ;-) > > Would we be the fir

Re: Allow tailoring of ICU locales with custom rules

2023-03-07 Thread Jeff Davis
On Fri, 2023-03-03 at 13:45 +0100, Peter Eisentraut wrote: > You can mess with people by setting up your databases like this: > > initdb -D data --locale-provider=icu --icu-rules='&a < c < b < e < d' > > ;-) Would we be the first major database to support custom collation rules? This sounds usef

Re: Allow tailoring of ICU locales with custom rules

2023-03-03 Thread Peter Eisentraut
On 02.03.23 16:39, Laurenz Albe wrote: On Wed, 2023-02-22 at 18:35 +0100, Peter Eisentraut wrote: - there doesn't seem to be a way to add rules to template1. If someone wants to have icu rules and initial contents to their new databases, I think they need to create a custom template database (fr

Re: Allow tailoring of ICU locales with custom rules

2023-03-02 Thread Laurenz Albe
On Wed, 2023-02-22 at 18:35 +0100, Peter Eisentraut wrote: > > - there doesn't seem to be a way to add rules to template1. > > If someone wants to have icu rules and initial contents to their new > > databases, I think they need to create a custom template database > > (from template0) for that pur

Re: Allow tailoring of ICU locales with custom rules

2023-02-22 Thread Peter Eisentraut
On 20.02.23 17:30, Daniel Verite wrote: - pg_dump support need to be added for CREATE COLLATION / DATABASE I have added that. - there doesn't seem to be a way to add rules to template1. If someone wants to have icu rules and initial contents to their new databases, I think they need to creat

Re: Allow tailoring of ICU locales with custom rules

2023-02-20 Thread Daniel Verite
Peter Eisentraut wrote: [patch v5] Two quick comments: - pg_dump support need to be added for CREATE COLLATION / DATABASE - there doesn't seem to be a way to add rules to template1. If someone wants to have icu rules and initial contents to their new databases, I think they need to crea

Re: Allow tailoring of ICU locales with custom rules

2023-02-20 Thread Peter Eisentraut
On 14.02.23 17:53, Laurenz Albe wrote: On Mon, 2023-02-06 at 22:16 +0100, Peter Eisentraut wrote: Right.  Here is a new patch with this fixed. Thanks. I played some more with it, and still are still some missing odds and ends: - There is a new option ICU_RULES to CREATE DATABASE, but it is n

Re: Allow tailoring of ICU locales with custom rules

2023-02-14 Thread Laurenz Albe
On Mon, 2023-02-06 at 22:16 +0100, Peter Eisentraut wrote: > Right.  Here is a new patch with this fixed. Thanks. I played some more with it, and still are still some missing odds and ends: - There is a new option ICU_RULES to CREATE DATABASE, but it is not reflected in \h CREATE DATABASE. sq

Re: Allow tailoring of ICU locales with custom rules

2023-02-06 Thread Peter Eisentraut
On 04.02.23 14:41, Daniel Verite wrote: However it still leaves "daticurules" empty in the destination db, because of an actual bug in the current patch. Looking at createdb() in commands.c, it creates this variable: @@ -711,6 +714,7 @@ createdb(ParseState *pstate, const CreatedbStmt *stmt)

Re: Allow tailoring of ICU locales with custom rules

2023-02-04 Thread Laurenz Albe
On Sat, 2023-02-04 at 14:41 +0100, Daniel Verite wrote: > Laurenz Albe wrote: > > > Cool so far.  Now I created a database with that locale: > > > >  CREATE DATABASE teutsch LOCALE_PROVIDER icu ICU_LOCALE german_phone > >     LOCALE "de_AT.utf8" TEMPLATE template0; > > > > Now the rules

Re: Allow tailoring of ICU locales with custom rules

2023-02-04 Thread Daniel Verite
Laurenz Albe wrote: > Cool so far. Now I created a database with that locale: > > CREATE DATABASE teutsch LOCALE_PROVIDER icu ICU_LOCALE german_phone > LOCALE "de_AT.utf8" TEMPLATE template0; > > Now the rules are not in "pg_database": The parameter after ICU_LOCALE is passed dire

Re: Allow tailoring of ICU locales with custom rules

2023-01-31 Thread Laurenz Albe
On Mon, 2023-01-16 at 12:18 +0100, Peter Eisentraut wrote: > Updated patch attached. I like that patch. It applies and passes regression tests. I played with it: CREATE COLLATION german_phone (LOCALE = 'de-AT', PROVIDER = icu, RULES = '&oe < ö'); SELECT * FROM (VALUES ('od'), ('oe'), ('of

Re: Allow tailoring of ICU locales with custom rules

2023-01-16 Thread Peter Eisentraut
On 11.01.23 03:50, vignesh C wrote: On Thu, 5 Jan 2023 at 20:45, Peter Eisentraut wrote: Patch needed a rebase; no functionality changes. The patch does not apply on top of HEAD as in [1], please post a rebased patch: Updated patch attached.From 8744abe8e56e25b8d76d1201c4fa40af273a09de Mon

Re: Allow tailoring of ICU locales with custom rules

2023-01-10 Thread vignesh C
On Thu, 5 Jan 2023 at 20:45, Peter Eisentraut wrote: > > Patch needed a rebase; no functionality changes. The patch does not apply on top of HEAD as in [1], please post a rebased patch: === Applying patches on top of PostgreSQL commit ID d952373a987bad331c0e499463159dd142ced1ef === === applying

Re: Allow tailoring of ICU locales with custom rules

2023-01-05 Thread Peter Eisentraut
Patch needed a rebase; no functionality changes. On 14.12.22 10:26, Peter Eisentraut wrote: This patch exposes the ICU facility to add custom collation rules to a standard collation.  This would allow users to customize any ICU collation to whatever they want.  A very simple example from the d