services: PostgreSQL: Quote database names.
* gnu/services/databases.scm (postgresql-create-roles): Quote the name in the SQL query so that roles/usernames containing hyphens will work.
This commit is contained in:
parent
e6554523af
commit
221985ce6b
1 changed files with 3 additions and 3 deletions
|
@ -396,12 +396,12 @@ and stores the database cluster in @var{data-directory}."
|
||||||
rolname = '" ,name "')) as not_exists;\n"
|
rolname = '" ,name "')) as not_exists;\n"
|
||||||
"\\gset\n"
|
"\\gset\n"
|
||||||
"\\if :not_exists\n"
|
"\\if :not_exists\n"
|
||||||
"CREATE ROLE " ,name
|
"CREATE ROLE \"" ,name "\""
|
||||||
" WITH " ,(format-permissions permissions)
|
" WITH " ,(format-permissions permissions)
|
||||||
";\n"
|
";\n"
|
||||||
,@(if create-database?
|
,@(if create-database?
|
||||||
`("CREATE DATABASE " ,name
|
`("CREATE DATABASE \"" ,name "\""
|
||||||
" OWNER " ,name ";\n")
|
" OWNER \"" ,name "\";\n")
|
||||||
'())
|
'())
|
||||||
"\\endif\n")))
|
"\\endif\n")))
|
||||||
roles)))
|
roles)))
|
||||||
|
|
Reference in a new issue