回答編集履歴

1

加筆修正

2018/06/18 03:45

投稿

退会済みユーザー
test CHANGED
@@ -3,6 +3,10 @@
3
3
  そもそもpostgresqlが起動していない説。
4
4
 
5
5
  postgresql.conf や pg_hba.conf の設定不良で起動できていないとか。
6
+
7
+ rootユーザーで、`systemctl status postgresql-9.6`とか実行すれば、
8
+
9
+ postgresqlが動いているかどうか分かるはず。
6
10
 
7
11
 
8
12
 
@@ -14,12 +18,16 @@
14
18
 
15
19
  それを確認するのに、
16
20
 
17
- psql -h hostname -d dbname -U user
21
+ `psql -h hostname -d dbname -U user`
18
22
 
19
23
 
20
24
 
21
- psql -d dbname -U user
25
+ `psql -d dbname -U user`
22
26
 
23
27
  を試して -h なしのときしかつながらないのであれば、
24
28
 
25
29
  確実にpg_hba.confの設定ミス。
30
+
31
+ -hオプションの有無が影響ない場合は、
32
+
33
+ postgresql.confにてlisten_addressesも念のために記述したほうがいいかもしれない。