
When connecting to a PostgreSQL server, you may get an error message. If youencounter an error message, please review the message carefully; each errormessage attempts to incorporate the information you’ll need to resolve theproblem. For more details about specific errors, please locate the errormessage in the list below:
I'm trying to get remote access to postgresql, installed on a server with IP A.A.A.A. There are two servers which one them has IP A.A.A.A, where postgresql has been installed on; and the other one. ERROR: could not connect to the publisher: FATAL: no pghba.conf entry for replication connection from host 2 Error: FATAL: no pghba.conf entry for host - PostgreSQL - pghba.conf is empty.
Connection to the server has been lost
This error message indicates that the connection attempt has taken longer thanthe specified threshold; there may be a problem with the connection propertiesprovided on the Server dialog, network connectivity issues, or the server maynot be running.
could not connect to Server: Connection refused
- the database server isn’t running - simply start it.
- the server isn’t configured to accept TCP/IP requests on the address shown.
For security reasons, a PostgreSQL server “out of the box” doesn’t listen onTCP/IP ports. Instead, it must be enabled to listen for TCP/IP requests. Thiscan be done by adding listen_addresses=’*’; this will make the server acceptconnections on any IP interface.
For further information, please refer to the PostgreSQL documentation aboutruntime configuration.
FATAL: no pg_hba.conf entry
If pgAdmin displays this message when connecting, your server can be contactedcorrectly over the network, but is not configured to accept your connection.Your client has not been detected as a legal user for the database.
To connect to a server, the pg_hba.conf file on the database server must beconfigured to accept connections from the host of the pgAdmin client. Modifythe pg_hba.conf file on the database server host, and add an entry in the form:
- host template1 postgres 192.168.0.0/24 md5 for an IPV4 network
- host template1 postgres ::ffff:192.168.0.0/120 md5 for an IPV6 network
For more information, please refer to the PostgreSQL documentation aboutclient authentication.
FATAL: password authentication failed
The password authentication failed for user error message indicates theremay be a problem with the password you entered. Retry the password to confirmyou entered it correctly. If the error message returns, make sure that you havethe correct password, that you are authorized to access the server, and thatthe access has been correctly configured in the server’s postgresql.confconfiguration file.
準備
postgresql94
AWS上にt1.smallでPostgresqlが動いているAmazonLinuxを2台構築。
参考にしたウェブサイト
エラー1
AWS の security group に自分自身のsgを許可(5432)
エラー2
pg_basebackup が動いた。
メモ
AmazonLinux の場合、
recovery.conf.sample
は
/usr/share/pgsql94/recovery.conf.sample
にあった。
エラー3
INSERT文が止まる。
アプリも動かない(nginx 504 error: Gateway Timeout)
参考にしたウェブサイトと違って client_addr や state などが空になっていた。
ただ、この状態はエラーの原因ではなかった。
psql から INSERTして応答がなかったので、controll + c した時のメッセージ。
このエラーは、
master db の postgresql.conf に書く、synchronous_standby_names の値と
slave db の recovery.conf に書く、primary_conninfo の中の値が違っていると発生するっぽい。
レコード自体は作られていた。