Here's the error message I am receiving.
could not translate host name "localhost" to address: hostname nor servname provided, or not known
From my searching, it seems like postgresql has crashed due to an error. If a proper shutdown is initiated, the message is different.
FATAL: the database system is shutting down
So I know it's not a proper shutdown of the database service that is occurring.
I am logging to syslog on a FreeBSD system. The log is very basic and essentially only shows me shutdown and startup attempts.
LOG: database system was shut down at 2017-05-08 09:20:16 EDT
LOG: database system is ready to accept connections
I am currently using default logging options. What do I need to change in order for PostgreSQL to log errors?
Requested Information
/etc/hosts:
127.0.0.1 localhost localhost.my.domain
DB connection code:
char conninfo[] = "host=localhost port=xxx dbname=xxx user=xxx password=xxx";
conn = PQconnectdb(conninfo);
if (PQstatus(conn) != CONNECTION_OK) {
print error
}
ping localhost
? Are you getting that error from thepsql
?