Specifying encoding on database creation
[hcoop/domtool2.git] / src / plugins / postgres.sml
index f80fcea..6465377 100644 (file)
@@ -26,9 +26,11 @@ fun adduser {user, passwd} =
 
 fun passwd _ = SOME "We don't use PostgreSQL passwords."
 
-fun createdb {user, dbname} =
+fun createdb {user, dbname, encoding} =
     Option.map (fn s => "Error executing CREATE DATABASE script:\n" ^ s)
-              (Slave.shellOutput [Config.Postgres.createdb, user, " ", dbname])
+              (Slave.shellOutput [Config.Postgres.createdb,
+                                  " ", user, " ", dbname,
+                                  case encoding of NONE => "" | SOME e => " " ^ e])
 
 fun dropdb {user, dbname} =
     Option.map (fn s => "Error executing DROP DATABASE script:\n" ^ s)