Re: More than one pg_database entry for database - Mailing list pgsql-admin

From Tom Lane
Subject Re: More than one pg_database entry for database
Date
Msg-id 11565.1183647202@sss.pgh.pa.us
Whole thread Raw
In response to More than one pg_database entry for database  ("James Wilford" <jwilford@mistral.net>)
Responses Re: More than one pg_database entry for database
List pgsql-admin
"James Wilford" <jwilford@mistral.net> writes:
> This shows 2 entries for "misp" with different OIDs. Only the first one
> (oid 31238435) exists in the data/base directory. So I tried to delete
> the other row but it doesn't work:

> misp=# DELETE from pg_database where oid = 6790290;
> DELETE 0

That's pretty strange.  I wonder if the index on pg_database.oid is
corrupt.  It certainly seems like the one on datname must be corrupt,
else it should have disallowed two such entries.

You could try deleting the bogus row by selecting it by ctid instead
of oid.  Also see if you can REINDEX pg_database (this will only work
in standalone mode I think).

What PG version is this exactly?

            regards, tom lane

pgsql-admin by date:

Previous
From: "James Wilford"
Date:
Subject: More than one pg_database entry for database
Next
From: Jessica Richard
Date:
Subject: how to get a list of members of a postgres group?