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

Commit 250f87d

Browse files
authored
Update postgres.md (#7119)
1 parent dfa0782 commit 250f87d

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

changelog.d/7119.doc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update postgres docs with login troubleshooting information.

docs/postgres.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,33 @@ Note that the PostgreSQL database *must* have the correct encoding set
6161

6262
You may need to enable password authentication so `synapse_user` can
6363
connect to the database. See
64-
<https://www.postgresql.org/docs/11/auth-pg-hba-conf.html>.
64+
<https://www.postgresql.org/docs/current/auth-pg-hba-conf.html>.
65+
66+
If you get an error along the lines of `FATAL: Ident authentication failed for
67+
user "synapse_user"`, you may need to use an authentication method other than
68+
`ident`:
69+
70+
* If the `synapse_user` user has a password, add the password to the `database:`
71+
section of `homeserver.yaml`. Then add the following to `pg_hba.conf`:
72+
73+
```
74+
host synapse synapse_user ::1/128 md5 # or `scram-sha-256` instead of `md5` if you use that
75+
```
76+
77+
* If the `synapse_user` user does not have a password, then a password doesn't
78+
have to be added to `homeserver.yaml`. But the following does need to be added
79+
to `pg_hba.conf`:
80+
81+
```
82+
host synapse synapse_user ::1/128 trust
83+
```
84+
85+
Note that line order matters in `pg_hba.conf`, so make sure that if you do add a
86+
new line, it is inserted before:
87+
88+
```
89+
host all all ::1/128 ident
90+
```
6591

6692
### Fixing incorrect `COLLATE` or `CTYPE`
6793

0 commit comments

Comments
 (0)