Re: Getting rid of duplicate tables.

From: Jared Carr <jared(at)89glass(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: Getting rid of duplicate tables.
Date: 2004-01-19 22:40:45
Message-ID: 400C5CED.9080606@89glass.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:

>Jared Carr <jared(at)89glass(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Carlos Costa Portela 2004-01-19 22:45:08 Re: Great change (size of data dir) upgrading postgresql
Previous Message Rich Hall 2004-01-19 22:40:16 Re: Tool to ease development of plpgsql