Re: [GENERAL] "Database does not exist" weirdness

Поиск
Список
Период
Сортировка
От Alan Hodgson
Тема Re: [GENERAL] "Database does not exist" weirdness
Дата
Msg-id 6421366.bTpXBSyCdR@skynet.simkin.ca
обсуждение исходный текст
Ответ на [GENERAL] "Database does not exist" weirdness  (Michael Tyson <michael@tyson.id.au>)
Список pgsql-general
On Friday 17 February 2017 18:18:20 Michael Tyson wrote:
> postgres=# \q
> pi@raspi ~ $ sudo -u postgres psql testdb
> psql: FATAL:  database "testdb" does not exist
> pi@raspi ~ $ sudo -u postgres createdb testdb
> createdb: database creation failed: ERROR:  duplicate key value violates
> unique constraint "pg_database_datname_index" DETAIL:  Key
> (datname)=(testdb) already exists.
>

Something's seriously borked in your PostgreSQL data files. The message it
should give you if the database exists is:

createdb: database creation failed: ERROR:  database "testdb" already exists

It looks like it partially exists in the catalog but not really. I can't guess
how you got to such a state, but you should probably nuke your data directory
and start over with a fresh initdb.


В списке pgsql-general по дате отправления:

Предыдущее
От: Tim Bellis
Дата:
Сообщение: Re: [GENERAL] Autovacuum stuck for hours, blocking queries
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [GENERAL] "Database does not exist" weirdness