Re: Can't pg_dumpall, claims database exists twice

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Can't pg_dumpall, claims database exists twice
Дата
Msg-id 455.1112030521@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Can't pg_dumpall, claims database exists twice  (Scott Ribe <scott_ribe@killerbytes.com>)
Ответы Re: Can't pg_dumpall, claims database exists twice  (Scott Ribe <scott_ribe@killerbytes.com>)
Re: Can't pg_dumpall, claims database exists twice  (Scott Ribe <scott_ribe@killerbytes.com>)
Список pgsql-general
Scott Ribe <scott_ribe@killerbytes.com> writes:
>> select ctid,oid,xmin,cmin,xmax,cmax,* from pg_database
>  ctid  |  oid   |  xmin  | cmin | xmax | cmax |  datname  | datdba |
> encoding | datistemplate | datallowconn | datlastsysoid | datvacuumxid |
> datfrozenxid | dattablespace | datconfig |         datacl
> -------+--------+--------+------+------+------+-----------+--------+--------
> --+---------------+--------------+---------------+--------------+-----------
> ---+---------------+-----------+------------------------
>  (0,1) | 288848 | 787399 |    0 |    0 |    0 | pedcard   |      1 |
> 0 | f             | t            |         17228 |          482 |
> 482 |          1663 |           |
>  (0,3) | 220622 |   3149 |    0 |    0 |    0 | pedcard   |      1 |
> 0 | f             | t            |         17228 |       770122 |
> 3221995595 |          1663 |           |

Now how the heck did that happen?  That's not some kind of weird UPDATE
failure, because the rows have different OIDs ... it seems like the
newer row must have been explicitly inserted, and it should surely have
been blocked by the unique index on datname.  Are there subdirectories
under $PGDATA/base for both of those OIDs?

If so, I'd suggest renaming one DB or the other by brute force, eg
    update pg_database set datname = 'pedcard2' where oid = 288848;
    checkpoint;
and then looking to see what you've got.  It's not obvious which of
these you want to keep.

            regards, tom lane

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

Предыдущее
От: Scott Ribe
Дата:
Сообщение: Re: Can't pg_dumpall, claims database exists twice
Следующее
От: Yudie Gunawan
Дата:
Сообщение: Table partition for very large table