orphan records in pg_class

From: Andrzej Pilacik <cypisek77(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: orphan records in pg_class
Date: 2014-09-16 20:46:51
Message-ID: CAJw8uJRnkVPvALK+QxUnx0sjrN5fSA+yWTmTbvx5OCM-n048uA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I inherited a 8.4.9 500gb database. After doing some analysis on it I
found two issues that I am not sure how to handle.

1. There is an object in pg_class that I can only query by oid or by using
ilike instead of = . That objects also only exists in pg_class, it does
not exist in pg_depend nor does it show up in any other system tables. Of
course, it does not show up in the database through pg_admin. This object
is a sequence. It is preventing me from taking a pg_dump of that schema
because it is telling me that the object does not exist. Can I just
remove this object from the pg_class table.

2. Same story for a pg_toast_xxxxxxxx table. It has a very high age of
relfrozenxid and I worry that soon, this will become an issue. Vacuum full
on all databases on this cluster does not help since the toast table does
not really belong to any real table. Can I remove this row from pg_class
or would it cause an issue? Do I have any other options to remove this
object?

Thank you.
Andrzej

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Paquier 2014-09-16 21:35:48 Re: PostgreSQL service account on Windows 7: Use a virtual account
Previous Message Adrian Klaver 2014-09-16 19:39:55 Re: pg_dump does not include database-level user-defined GUC variables?