From: Brian McCane <bmccane@mccons.net>
To: pgsql-admin@postgresql.org
Subject: Missing pg_clog file
Date: Sun, 27 Oct 2002 11:38:34 -0600 (CST)
Message-ID: <20021027112340.G99083-100000@fw.mccons.net> (raw)
In-Reply-To: <19177.1020953351@sss.pgh.pa.us>
My database ran out of disk space the other day (I usually monitor better
but my wife is having chemo and that is more important). Anyway, I
shtudown the server using the 'pg_ctl stop' command, moved about 6GB of
indexes to another drive and fixed all the links. After I restarted the
server everything looked fine until I got:
FATAL 2: open of /usr/local/pgsql/data/pg_clog/0000 failed: No such file
or directory
This happens about every 30-40 minutes, then the server comes up and
behaves okay for a while until *POOF*.
I tried to dump my databases to one of my alternate servers, but it fails
because I have duplicate records in miscellaneous tables in a primary key.
I tried to get smart and changed the primary key to include the oid,
figuring that would make it unique, and it would also be easier to delete
one of the conflicting records. When I started the dump, I got the same
error. After many hours running on a table with about 200M records:
SELECT oid,cnt FROM (SELECT oid,count(oid) AS cnt FROM foo GROUP BY oid)
as bar WHERE cnt > 1 ;
I discovered that I have a bunch (20,000+) of records that have duplicated
oid numbers. Is this because of the disk running out of space or is it
some deeper more evil problem. Also, how the %!$#! do I fix it without
losing the associated data? Most of the records are identical (maybe
all), and when I delete any 1, all of them disappear. I guess I could
select distinct into a temporary table, delete from current, and then
insert from the temporary table, but this is gonna take a long time.
- brian
Wm. Brian McCane | Life is full of doors that won't open
Search http://recall.maxbaud.net/ | when you knock, equally spaced amid those
Usenet http://freenews.maxbaud.net/ | that open when you don't want them to.
Auction http://www.sellit-here.com/ | - Roger Zelazny "Blood of Amber"
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: bmccane@mccons.net
Subject: Re: Missing pg_clog file
In-Reply-To: <20021027112340.G99083-100000@fw.mccons.net>
References: <19177.1020953351@sss.pgh.pa.us> <20021027112340.G99083-100000@fw.mccons.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox