From b664fae51766d9feb497e09d3e4efe286319337b Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Fri, 15 Mar 2024 10:16:50 +0100 Subject: [PATCH] fix initial connection in create-database script --- tasks.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tasks.py b/tasks.py index 80844fa..3d82555 100644 --- a/tasks.py +++ b/tasks.py @@ -14,8 +14,13 @@ def create_database(ctx): db_password = os.environ.get("POSTGRES_PASSWORD") # Establishing connection to PostgreSQL server + # (connect to initial database 'postgres' to create a new database) conn = psycopg2.connect( - host=db_host, port=db_port, user=db_user, password=db_password + host=db_host, + port=db_port, + dbname="postgres", + user=db_user, + password=db_password, ) conn.autocommit = True cursor = conn.cursor()