diff options
author | Michael J. Schultz <mjschultz@gmail.com> | 2014-12-23 14:16:29 -0600 |
---|---|---|
committer | James Cammarata <jimi@sngx.net> | 2015-02-17 14:41:22 -0600 |
commit | 42e494671cb6ace9552bede1c7c08f7b357b40ca (patch) | |
tree | 010fed5ff700954f4b950c2acb7335686754146a | |
parent | 2919abf6c03095ddf986227215ff39c57b2c8cdb (diff) | |
download | ansible-modules-core-42e494671cb6ace9552bede1c7c08f7b357b40ca.tar.gz |
Build the db connection on `"postgres"` instead of `"template1"`
According to the postgresql docs[1], you should not have a connection with
`"template1"` when copying multiple databases.
[1]: http://www.postgresql.org/docs/9.1/static/manage-ag-templatedbs.html
-rw-r--r-- | database/postgresql/postgresql_db.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/database/postgresql/postgresql_db.py b/database/postgresql/postgresql_db.py index f965eac2..b5264cab 100644 --- a/database/postgresql/postgresql_db.py +++ b/database/postgresql/postgresql_db.py @@ -263,7 +263,7 @@ def main(): kw = dict( (params_map[k], v) for (k, v) in module.params.iteritems() if k in params_map and v != '' ) try: - db_connection = psycopg2.connect(database="template1", **kw) + db_connection = psycopg2.connect(database="postgres", **kw) # Enable autocommit so we can create databases if psycopg2.__version__ >= '2.4.2': db_connection.autocommit = True |