16053: Specify utf8 encoding when creating databases.
authorTom Clegg <tom@tomclegg.ca>
Wed, 25 Mar 2020 18:57:42 +0000 (14:57 -0400)
committerTom Clegg <tom@tomclegg.ca>
Wed, 25 Mar 2020 18:57:42 +0000 (14:57 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@tomclegg.ca>

lib/boot/postgresql.go
sdk/python/tests/run_test_server.py

index df90f36af759d41f1d582aff217bce0ee1fed145..34ccf04a88dbd68a7822cc75b13da972e32844ee 100644 (file)
@@ -154,7 +154,7 @@ func (runPostgreSQL) Run(ctx context.Context, fail func(error), super *Superviso
        if err != nil {
                return fmt.Errorf("createuser failed: %s", err)
        }
-       _, err = conn.ExecContext(ctx, `CREATE DATABASE `+pq.QuoteIdentifier(super.cluster.PostgreSQL.Connection["dbname"]))
+       _, err = conn.ExecContext(ctx, `CREATE DATABASE `+pq.QuoteIdentifier(super.cluster.PostgreSQL.Connection["dbname"])+` WITH TEMPLATE template0 ENCODING 'utf8'`)
        if err != nil {
                return fmt.Errorf("createdb failed: %s", err)
        }
index f5ee9c38327e5ae1c95ad9766f36ffc987757019..4f4d13858d3bcd72feb0c1f95a1b19fb536763b8 100644 (file)
@@ -675,6 +675,7 @@ def setup_config():
            "dbname": "arvados_test",
            "user": "arvados",
            "password": "insecure_arvados_test",
+            "template": "template0", # used by RailsAPI when [re]creating the database
         }
 
     localhost = "127.0.0.1"