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

Commit

Permalink
Updated warning for incorrect database collation/ctype (#6985)
Browse files Browse the repository at this point in the history
Signed-off-by: Uday Bansal <43824981+udaybansal19@users.noreply.github.com>
  • Loading branch information
udaybansal19 authored Feb 26, 2020
1 parent 8c75b62 commit 7728d87
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
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

0 comments on commit 7728d87

Please sign in to comment.