diff --git a/pytest_postgresql/janitor.py b/pytest_postgresql/janitor.py index 7636f1cc..289629fd 100644 --- a/pytest_postgresql/janitor.py +++ b/pytest_postgresql/janitor.py @@ -66,7 +66,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'CREATE DATABASE "{self.template_dbname}" WITH IS_TEMPLATE = TRUE;') elif self.template_dbname is None: cur.execute(f'CREATE DATABASE "{self.dbname}";') else: