Bug #16436

[install] Ensure postgresql has en_US.UTF-8 collation

Added by Tom Clegg over 1 year ago.

Status:
New
Priority:
Normal
Assigned To:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Story points:
-

Description

Tests rely on en_US.UTF-8 database collation, see source:apps/workbench/test/controllers/projects_controller_test.rb#L492

arvados-server install installs the en_US.UTF-8 locale.

run-tests.sh sets LANG=en_US.UTF-8.

However, the outcome appears to be sensitive to whether the locale was installed before or after `initdb`. If initdb ran first, postgresql doesn't know about the collation.

arvados-server install should do something like this after setting up the locale:

create collation if not exists "en_US.utf8" (LOCALE = 'en_US.utf8');
create collation if not exists "en_US" (LOCALE = 'en_US.utf8');

(It's not good enough for arvados-server install to install the locale before installing postgresql, because postgresql might already be installed before arvados-server install starts. Postgresql 11+ includes a function pg_import_system_collations('pg_catalog') but this only works if the postgresql server has restarted since the locale was added.)

Also available in: Atom PDF