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

Updated warning for incorrect database collation/ctype #6985

Merged
merged 3 commits into from
Feb 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/6985.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update warning for incorrect database collation/ctype to include link to documentation.
10 changes: 7 additions & 3 deletions synapse/storage/engines/postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def check_database(self, db_conn, allow_outdated_version: bool = False):
if rows and rows[0][0] != "UTF8":
raise IncorrectDatabaseSetup(
"Database has incorrect encoding: '%s' instead of 'UTF8'\n"
"See docs/postgres.rst for more information." % (rows[0][0],)
"See docs/postgres.md for more information." % (rows[0][0],)
)

txn.execute(
Expand All @@ -62,12 +62,16 @@ def check_database(self, db_conn, allow_outdated_version: bool = False):
collation, ctype = txn.fetchone()
if collation != "C":
logger.warning(
"Database has incorrect collation of %r. Should be 'C'", collation
"Database has incorrect collation of %r. Should be 'C'\n"
"See docs/postgres.md for more information.",
collation,
)

if ctype != "C":
logger.warning(
"Database has incorrect ctype of %r. Should be 'C'", ctype
"Database has incorrect ctype of %r. Should be 'C'\n"
"See docs/postgres.md for more information.",
ctype,
)

def check_new_database(self, txn):
Expand Down