Skip to content

Using io_method=sync in postgresql.conf file is causing psql client to fail with database "postgres" does not exist #3

@VikasPatnala

Description

@VikasPatnala

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.

  1. Initializing the database
    • $ bin/initdb -D mydb
  2. Change the io_method parameter to sync
    • $ vim mydb/postgresql.conf
    • change io_method to sync
  3. Start the postgres server
    • $ bin/pg_ctl -D mydb -l logfile start -o "-d 5"
  4. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions