1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge pull request #2485 from jochu/bug-postgresql-quotes

Add quotes around postgresql database name
This commit is contained in:
Michael DeHaan 2013-03-22 13:15:53 -07:00
commit 934029842e

View file

@ -124,7 +124,7 @@ def db_create(cursor, db, owner, template, encoding):
template = " TEMPLATE \"%s\"" % template
if encoding:
encoding = " ENCODING '%s'" % encoding
query = "CREATE DATABASE %s%s%s%s" % (db, owner, template, encoding)
query = "CREATE DATABASE \"%s\"%s%s%s" % (db, owner, template, encoding)
cursor.execute(query)
return True
elif owner and not db_owned_by(cursor, db, owner):