Re: Getting rid of duplicate tables.

Поиск
Список
Период
Сортировка
От Jared Carr
Тема Re: Getting rid of duplicate tables.
Дата
Msg-id 400C5CED.9080606@89glass.com
обсуждение исходный текст
Ответ на Re: Getting rid of duplicate tables.  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Getting rid of duplicate tables.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Tom Lane wrote:

>Jared Carr <jared@89glass.com> writes:
>
>
>>First I wish I knew how this was caused but here is our problem.
>>Sometime in the recent past we got a duplicate table.  Here is the
>>result of a pg_dump with a pg_restore for just that table.
>>
>>
>
>This should be fairly easy to fix: manually DELETE the extra pg_class
>entry (selecting it by ctid, since there isn't any other way to select
>just one of them).  However, please don't do that until we've exhausted
>the opportunity to figure out how this happened.
>
>For starters, what PG version is this?  And how many entries are there
>in pg_class at the moment?  (The output from "VACUUM VERBOSE pg_class"
>would be useful to look at.)
>
>            regards, tom lane
>
>
This is version 7.4.1 (upgraded from 7.4 about 3 weeks ago).

INFO:  vacuuming "pg_catalog.pg_class"
INFO:  index "pg_class_oid_index" now contains 412 row versions in 7 pages
DETAIL:  0 index pages have been deleted, 0 are currently reusable.
CPU 0.00s/0.00u sec elapsed 0.00 sec.
INFO:  index "pg_class_relname_nsp_index" now contains 412 row versions
in 25 pages
DETAIL:  0 index pages have been deleted, 0 are currently reusable.
CPU 0.00s/0.00u sec elapsed 0.00 sec.
INFO:  "pg_class": found 0 removable, 412 nonremovable row versions in
31 pages
DETAIL:  0 dead row versions cannot be removed yet.
There were 1216 unused item pointers.
0 pages are entirely empty.
CPU 0.00s/0.00u sec elapsed 0.00 sec.

Query returned successfully with no result in 20 ms.

And the contents of pg_class relating to this table.

live=# select * from pg_class where relname='order_to_do';
   relname   | relnamespace | reltype  | relowner | relam | relfilenode
| relpages | reltuples | reltoastrelid | reltoastidxid | relhasindex |
relisshared | relkind | relnatts | relchecks | reltriggers | relukeys |
relfkeys | relrefs | relhasoids | relhaspkey | relhasrules |
relhassubclass | relacl

-------------+--------------+----------+----------+-------+-------------+----------+-----------+---------------+---------------+-------------+-------------+---------+----------+-----------+-------------+----------+----------+---------+------------+------------+-------------+----------------+--------
 order_to_do |         2200 | 11462033 |      101 |     0 |    11462032
|      506 |     59401 |      11462039 |             0 | t           |
f           | r       |        5 |         0 |           1 |        0
|        0 |       0 | t          | t          | f           |
f              |
 order_to_do |         2200 | 11462033 |      101 |     0 |    11462032
|      453 |     53407 |      11462039 |             0 | t           |
f           | r       |        5 |         0 |           1 |        0
|        0 |       0 | t          | t          | f           |
f              |
(2 rows)

Thanks for the help, and let me know if you need any more information.

Jared

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

Предыдущее
От: Rich Hall
Дата:
Сообщение: Re: Tool to ease development of plpgsql
Следующее
От: Carlos Costa Portela
Дата:
Сообщение: Re: Great change (size of data dir) upgrading postgresql