From 28e35af65a204c7855d68781043ff3dc6a5b2f1a Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Thu, 9 Nov 2023 14:15:17 -0500 Subject: [PATCH 1/2] Use dbname instead of database for Postgres config. --- docs/postgres.md | 2 +- docs/usage/configuration/config_documentation.md | 6 +++--- tests/server.py | 6 +++--- tests/utils.py | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/postgres.md b/docs/postgres.md index 02d4b9b162f6..ad7c6a0738d3 100644 --- a/docs/postgres.md +++ b/docs/postgres.md @@ -66,7 +66,7 @@ database: args: user: password: - database: + dbname: host: cp_min: 5 cp_max: 10 diff --git a/docs/usage/configuration/config_documentation.md b/docs/usage/configuration/config_documentation.md index a1ca5fa98c22..a673975e0411 100644 --- a/docs/usage/configuration/config_documentation.md +++ b/docs/usage/configuration/config_documentation.md @@ -1447,7 +1447,7 @@ database: args: user: synapse_user password: secretpassword - database: synapse + dbname: synapse host: localhost port: 5432 cp_min: 5 @@ -1526,7 +1526,7 @@ databases: args: user: synapse_user password: secretpassword - database: synapse_main + dbname: synapse_main host: localhost port: 5432 cp_min: 5 @@ -1539,7 +1539,7 @@ databases: args: user: synapse_user password: secretpassword - database: synapse_state + dbname: synapse_state host: localhost port: 5432 cp_min: 5 diff --git a/tests/server.py b/tests/server.py index c8342db399ab..5a63ecee9f2d 100644 --- a/tests/server.py +++ b/tests/server.py @@ -974,7 +974,7 @@ def setup_test_homeserver( database_config = { "name": "psycopg2", "args": { - "database": test_db, + "dbname": test_db, "host": POSTGRES_HOST, "password": POSTGRES_PASSWORD, "user": POSTGRES_USER, @@ -1033,7 +1033,7 @@ def setup_test_homeserver( import psycopg2.extensions db_conn = db_engine.module.connect( - database=POSTGRES_BASE_DB, + dbname=POSTGRES_BASE_DB, user=POSTGRES_USER, host=POSTGRES_HOST, port=POSTGRES_PORT, @@ -1080,7 +1080,7 @@ def cleanup() -> None: # Drop the test database db_conn = db_engine.module.connect( - database=POSTGRES_BASE_DB, + dbname=POSTGRES_BASE_DB, user=POSTGRES_USER, host=POSTGRES_HOST, port=POSTGRES_PORT, diff --git a/tests/utils.py b/tests/utils.py index e73b46944bd9..a0c87ad628bf 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -80,7 +80,7 @@ def setupdb() -> None: # Set up in the db db_conn = db_engine.module.connect( - database=POSTGRES_BASE_DB, + dbname=POSTGRES_BASE_DB, user=POSTGRES_USER, host=POSTGRES_HOST, port=POSTGRES_PORT, From 6e980abc016553f299e01286499c97d25da2f03c Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Thu, 9 Nov 2023 14:17:28 -0500 Subject: [PATCH 2/2] Newsfragment --- changelog.d/16618.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/16618.misc diff --git a/changelog.d/16618.misc b/changelog.d/16618.misc new file mode 100644 index 000000000000..c026e6b995df --- /dev/null +++ b/changelog.d/16618.misc @@ -0,0 +1 @@ +Use `dbname` instead of the deprecated `database` connection parameter for psycopg2.