When using io_method=sync in postgresql.conf file and start the client as follows is causing client to fail with error psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: FATAL: database "postgres" does not exist here is the demonstration.
- Initializing the database
- Change the io_method parameter to sync
- $ vim mydb/postgresql.conf
- change io_method to sync
- Start the postgres server
- $ bin/pg_ctl -D mydb -l logfile start -o "-d 5"
- Start the client
- $ bin/psql -d postgres
psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: FATAL: database "postgres" does not exist
Here postgres, template0, template1 are the default databases that postgresql will create in the initdb phase and these are created as intended that we checked with invoking postgres in single user mode. (references for this in documentation: https://www.postgresql.org/docs/current/creating-cluster.html#CREATING-CLUSTER)