move collation import to backend - Mailing list pgsql-hackers

From Peter Eisentraut
Subject move collation import to backend
Date
Msg-id b78a8524-0412-5605-54d1-972b481eb16d@2ndquadrant.com
Whole thread Raw
Responses Re: move collation import to backend  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Currently, initdb parses locale -a output to populate pg_collation.  If
additional collations are installed in the operating system, it is not
possible to repeat this process, only by doing each step manually.  So I
propose to move this to a backend function that can be called
separately, and have initdb call that.  Running this logic in the
backend instead of initdb also makes the code simpler.  If we add other
collation providers such as ICU, initdb doesn't need to know about that
at all, because all the logic would be contained in the backend.

Here is an example:

    select pg_import_system_collations(if_not_exists => false, schema =>
'test');

(Specifying the schema also allows testing this without overwriting
pg_catalog.)

I thought about making this a top-level command (IMPORT COLLATIONS ...
?) but decided against it for now, to keep it simple.  Right now, this
is more of a refactoring.  Documentation could be added if we decide so.

--
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: "Tsunakawa, Takayuki"
Date:
Subject: Re: [RFC] Should we fix postmaster to avoid slow shutdown?
Next
From: Peter Eisentraut
Date:
Subject: Re: make coverage-html on OS X