Merge pull request #32 from antaflos/quote-dbname

Properly quote database name when using postgresql::psql
This commit is contained in:
Chris Price 2012-11-09 08:13:31 -08:00
commit 7612cb9539
2 changed files with 2 additions and 2 deletions

View file

@ -38,7 +38,7 @@ define postgresql::database(
# This will prevent users from connecting to the database unless they've been # This will prevent users from connecting to the database unless they've been
# granted privileges. # granted privileges.
postgresql::psql {"REVOKE CONNECT ON DATABASE ${dbname} FROM public": postgresql::psql {"REVOKE CONNECT ON DATABASE \"${dbname}\" FROM public":
db => 'postgres', db => 'postgres',
user => 'postgres', user => 'postgres',
unless => 'SELECT 1 where 1 = 0', unless => 'SELECT 1 where 1 = 0',

View file

@ -49,7 +49,7 @@ define postgresql::database_grant(
default => $privilege, default => $privilege,
} }
postgresql::psql { "GRANT ${privilege} ON database ${db} TO \"${role}\"": postgresql::psql { "GRANT ${privilege} ON database \"${db}\" TO \"${role}\"":
db => $psql_db, db => $psql_db,
user => $psql_user, user => $psql_user,
unless => "SELECT 1 WHERE has_database_privilege('${role}', '${db}', '${unless_privilege}')", unless => "SELECT 1 WHERE has_database_privilege('${role}', '${db}', '${unless_privilege}')",