Ensure pg data dir exists

This commit is contained in:
Edgar Ramírez-Mondragón 2024-10-05 01:35:47 -06:00
parent 26f0f13b39
commit 0eccfbec47
No known key found for this signature in database
GPG Key ID: 74C40D09C7B42099

View File

@ -99,6 +99,7 @@ def configure_postgres():
Set up PostgreSQL config before the service starts. Set up PostgreSQL config before the service starts.
""" """
logger.info("Configuring Postgres") logger.info("Configuring Postgres")
opt.pg_data_dir.mkdir(parents=True, exist_ok=True)
with (opt.pg_data_dir / 'postgresql.conf').open('a') as f: with (opt.pg_data_dir / 'postgresql.conf').open('a') as f:
# allow > 1 prepared transactions for test cases # allow > 1 prepared transactions for test cases
print("max_prepared_transactions = 10", file=f) print("max_prepared_transactions = 10", file=f)