Re: psql: FATAL: database "postgres" does not exist or ERROR: 23505: duplicate key value violates unique constraint "pg_namespace_nspname_index" - Mailing list pgsql-general

From Naresh Kumar
Subject Re: psql: FATAL: database "postgres" does not exist or ERROR: 23505: duplicate key value violates unique constraint "pg_namespace_nspname_index"
Date
Msg-id CAKtdDBDv5taUq3hkTptsf4-3vq-XgCPxt8Zs45zbaV6tgEMMnQ@mail.gmail.com
Whole thread Raw
In response to RE: psql: FATAL: database "postgres" does not exist or ERROR: 23505: duplicate key value violates unique constraint "pg_namespace_nspname_index"  ("Daniel Verite" <daniel@manitou-mail.org>)
Responses Re: psql: FATAL: database "postgres" does not exist or ERROR: 23505: duplicate key value violates unique constraint "pg_namespace_nspname_index"
List pgsql-general
Thanks Denial,

Already I tried to connect with template0, template1, user database name, postgres, nothing is working getting same error message as mentioned in trail mail.

For the second one, yes we don't have backups to restore, we don't have any option apart from data directory(no wal files)

Regards,
Narresh


On Wed 15 Jul, 2020, 3:28 PM Daniel Verite <daniel@manitou-mail.org wrote:
        TALLURI Nareshkumar wrote:

>      [0]postgres@axmdevhkdb008$ [PHKGAXMD008] psql
> psql: FATAL:  database "postgres" does not exist

That's not necessarily a problem. The "postgres" database is generally
empty and some installations don't even have one.
Use "psql -d template1" instead, or start postgres in single-user mode.

> Since we are not able to connect to DB , we did a new initialization and
> copy the directories from base directory to new base directory(in new data
> location)

This can't work. If you have a backup from just before that point,
you should restore it and work from that without writing anything into
the data directory.


Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: https://www.manitou-mail.org
Twitter: @DanielVerite


pgsql-general by date:

Previous
From: Rob Sargent
Date:
Subject: Re: 2 million queries against a table
Next
From: Eudald Valcàrcel Lacasa
Date:
Subject: Re: Issue executing query from container