From c069783f522e0ca55329b48cd7de28fc1c1ac5d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20=C5=9Aliwi=C5=84ski?= Date: Mon, 11 Mar 2024 14:38:18 +0100 Subject: [PATCH] Small change to template database initialisation --- pytest_postgresql/janitor.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pytest_postgresql/janitor.py b/pytest_postgresql/janitor.py index 0421bed8..d8f68ed7 100644 --- a/pytest_postgresql/janitor.py +++ b/pytest_postgresql/janitor.py @@ -67,8 +67,7 @@ def init(self) -> None: """Create database in postgresql.""" with self.cursor() as cur: if self.is_template(): - cur.execute(f'CREATE DATABASE "{self.template_dbname}";') - cur.execute(f'ALTER DATABASE "{self.template_dbname}" with is_template true;') + cur.execute(f'CREATE DATABASE "{self.template_dbname}" WITH is_template = true;') elif self.template_dbname is None: cur.execute(f'CREATE DATABASE "{self.dbname}";') else: