Re: 'SGT DETAIL: Could not open file "pg_clog/05DC": No such file or directory' - what to do now?

From: Tomasz Chmielewski <mangoo(at)wpkg(dot)org>
To: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
Cc: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, pgsql-admin(at)postgresql(dot)org
Subject: Re: 'SGT DETAIL: Could not open file "pg_clog/05DC": No such file or directory' - what to do now?
Date: 2011-05-07 21:19:16
Message-ID: 4DC5B754.3040506@wpkg.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

On 06.05.2011 10:42, Tomasz Chmielewski wrote:
> On 04.05.2011 22:27, Tomasz Chmielewski wrote:
>
>>>> Then another pg_clog file disappeared.
>>
>> OK, I have:
>>
>> bookstor=# SELECT * FROM core_wot_seq;
>> sequence_name | last_value | increment_by | max_value | min_value |
>> cache_value | log_cnt | is_cycled | is_called
>> ------------------+------------+--------------+---------------------+-----------+-------------+---------+-----------+-----------
>>
>> core_wot_seq | 2593 | 1 | 9223372036854775807 | 1 | 1 | 8 | f | t
>> (1 row)
>>
>> bookstor=# SELECT 1 FROM core_wot_seq;
>> ?column?
>> ----------
>> 1
>> (1 row)
>>
>> bookstor=# SELECT 1 FROM core_wot_seq FOR UPDATE;
>> ERROR: could not access status of transaction 1573786613
>> DETAIL: Could not open file "pg_clog/05DC": No such file or directory.
>>
>> How do I best recover from this? Stop postgres, create an empty, 256k
>> pg_clog/05DC file, start postgres?
>>
>> Export table, drop table, import table? Anything else?
>
> Nobody has a clue? :|

Just as a follow up, it turned out several sequences, and only sequences
were affected this way.

I used pg_dump to export these sequences, dropped the sequences, and
imported them again.

As there were some tables which depended on these sequences, I had to
use ALTER TABLE as well several times - grepping for the affected
sequence in the whole database dump gave me hints on what I had to do.

--
Tomasz Chmielewski
http://wpkg.org

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Surachai Locharoen 2011-05-09 06:08:23 hi
Previous Message Thomas Kellerer 2011-05-07 11:00:29 Re: (unknown)

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2011-05-07 21:24:52 Re: Prefered Types
Previous Message Andrew Dunstan 2011-05-07 21:16:50 Re: Why not install pgstattuple by default?