Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Use dbname instead of database for Postgres config. (#16618)
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep authored Nov 9, 2023
1 parent 9f514dd commit bc4372a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions changelog.d/16618.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use `dbname` instead of the deprecated `database` connection parameter for psycopg2.
2 changes: 1 addition & 1 deletion docs/postgres.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ database:
args:
user: <user>
password: <pass>
database: <db>
dbname: <db>
host: <host>
cp_min: 5
cp_max: 10
Expand Down
6 changes: 3 additions & 3 deletions docs/usage/configuration/config_documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -1447,7 +1447,7 @@ database:
args:
user: synapse_user
password: secretpassword
database: synapse
dbname: synapse
host: localhost
port: 5432
cp_min: 5
Expand Down Expand Up @@ -1526,7 +1526,7 @@ databases:
args:
user: synapse_user
password: secretpassword
database: synapse_main
dbname: synapse_main
host: localhost
port: 5432
cp_min: 5
Expand All @@ -1539,7 +1539,7 @@ databases:
args:
user: synapse_user
password: secretpassword
database: synapse_state
dbname: synapse_state
host: localhost
port: 5432
cp_min: 5
Expand Down
6 changes: 3 additions & 3 deletions tests/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit bc4372a

Please sign in to comment.