From aa17c06fb58533d09c79c68a4d34a6f56687ee38 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 18 Jan 2017 12:00:00 -0500 Subject: Add function to import operating system collations Move this logic out of initdb into a user-callable function. This simplifies the code and makes it possible to update the standard collations later on if additional operating system collations appear. Reviewed-by: Andres Freund Reviewed-by: Euler Taveira --- doc/src/sgml/charset.sgml | 2 +- doc/src/sgml/func.sgml | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) (limited to 'doc/src/sgml') diff --git a/doc/src/sgml/charset.sgml b/doc/src/sgml/charset.sgml index f8c7ac3b169..2aba0fc5282 100644 --- a/doc/src/sgml/charset.sgml +++ b/doc/src/sgml/charset.sgml @@ -496,7 +496,7 @@ SELECT * FROM test1 ORDER BY a || b COLLATE "fr_FR"; - + Managing Collations diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 10e31868baf..eb1b6984bf0 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -19190,6 +19190,46 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup()); in the database's default tablespace, the tablespace can be specified as 0. + + lists functions used to manage + collations. + + + + Collation Management Functions + + + Name Return Type Description + + + + + + pg_import_system_collations + pg_import_system_collations(if_not_exists boolean, schema regnamespace) + + void + Import operating system collations + + + +
+ + + pg_import_system_collations populates the system + catalog pg_collation with collations based on all the + locales it finds on the operating system. This is + what initdb uses; + see for more details. If additional + locales are installed into the operating system later on, this function + can be run again to add collations for the new locales. In that case, the + parameter if_not_exists should be set to true to + skip over existing collations. The schema + parameter would typically be pg_catalog, but that is + not a requirement. (Collation objects based on locales that are no longer + present on the operating system are never removed by this function.) + +
-- cgit v1.2.3