guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: services: PostgreSQL: Quote database names.


From: guix-commits
Subject: branch master updated: services: PostgreSQL: Quote database names.
Date: Sat, 06 Feb 2021 09:57:32 -0500

This is an automated email from the git hooks/post-receive script.

mbakke pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 221985c  services: PostgreSQL: Quote database names.
221985c is described below

commit 221985ce6bd8036ceac3d1973be3dc084f52b1de
Author: Marius Bakke <marius@gnu.org>
AuthorDate: Sat Feb 6 15:18:40 2021 +0100

    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.
---
 gnu/services/databases.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gnu/services/databases.scm b/gnu/services/databases.scm
index c118986..d908b86 100644
--- a/gnu/services/databases.scm
+++ b/gnu/services/databases.scm
@@ -396,12 +396,12 @@ and stores the database cluster in @var{data-directory}."
 rolname = '" ,name "')) as not_exists;\n"
 "\\gset\n"
 "\\if :not_exists\n"
-"CREATE ROLE " ,name
+"CREATE ROLE \"" ,name "\""
 " WITH " ,(format-permissions permissions)
 ";\n"
 ,@(if create-database?
-      `("CREATE DATABASE " ,name
-        " OWNER " ,name ";\n")
+      `("CREATE DATABASE \"" ,name "\""
+        " OWNER \"" ,name "\";\n")
       '())
 "\\endif\n")))
             roles)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]