Re: More than one pg_database entry for database

From: "James Wilford" <jwilford(at)mistral(dot)net>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: More than one pg_database entry for database
Date: 2007-07-05 16:38:48
Message-ID: BA2CC7B7A60EF64B968B268B500397CB11B320@migsexch01.miint.mistral.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: 05 July 2007 17:27
To: James Wilford
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: [ADMIN] More than one pg_database entry for database

"James Wilford" <jwilford(at)mistral(dot)net> writes:
> Its PG version 7.3.

Please tell us it's a relatively recent 7.3.x, at least ...

> I've just tried all your suggestions and unfortunately I still can't
> delete the bogus row. I think I managed to reindex the system tables:

Curious. I'd have thought the reindex would fail because of the
duplicate datname entries.

> And trying ctid didn't work, assuming this syntax is correct:
> backend> delete from pg_database where ctid = '(0,37)';

Even more curious. I'm starting to think it's some sort of XID
wraparound problem, except if you can see it in SELECT then why doesn't
the DELETE see it?

Could you show all the system columns of pg_database, viz

select xmin, cmin, xmax, cmax, oid, ctid, datname from pg_database;

regards, tom lane

It's a redhat version of 7.3 - rh-postgresql-server-7.3.8-2 is the
package.

Here's the system colums:

misp=# select xmin, cmin, xmax, cmax, oid, ctid, datname from
pg_database;
xmin | cmin | xmax | cmax | oid | ctid |
datname
----------+------------+------------+------+----------+--------+--------
---
2 | 2304646034 | 2304646034 | 0 | 9019080 | (0,3) |
webstats
2 | 0 | 0 | 0 | 21676718 | (0,4) |
webstats
2 | 0 | 0 | 0 | 1 | (0,6) |
template1
2 | 0 | 0 | 0 | 16975 | (0,7) |
template0
2 | 2425306827 | 2425306827 | 0 | 15062595 | (0,16) |
misp_jon2
2 | 0 | 0 | 0 | 25823532 | (0,19) |
misptest
2 | 0 | 0 | 0 | 3988824 | (0,23) | devices
45097349 | 0 | 0 | 0 | 30149940 | (0,26) | status
59253569 | 0 | 0 | 0 | 30153251 | (0,27) |
mispcopy
59254726 | 0 | 0 | 0 | 31238435 | (0,28) | misp
2 | 2430588419 | 2430588419 | 0 | 6790290 | (0,37) | misp
2 | 2425306819 | 2425306819 | 0 | 7511185 | (0,38) |
misp_jon
(12 rows)

The "webstats" database also appears twice, although we're more
concerned about "misp" at the moment.

James

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Chris Browne 2007-07-05 16:44:13 Re: Help me find a suitable replication solution
Previous Message Tom Lane 2007-07-05 16:26:44 Re: More than one pg_database entry for database