Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 1EA9C1337B8A for ; Wed, 20 Oct 2010 13:57:28 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 38754-02 for ; Wed, 20 Oct 2010 16:57:20 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 4EEB21337B47 for ; Wed, 20 Oct 2010 13:57:20 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o9KGvGK2029689; Wed, 20 Oct 2010 12:57:16 -0400 (EDT) To: "Aleksandr Dushein" cc: pgsql-bugs@postgresql.org, Bruce Momjian Subject: Re: BUG #5718: Cannot start postgres (FATAL: invalid cache id: 19) In-reply-to: <201010200944.o9K9i981095017@wwwmaster.postgresql.org> References: <201010200944.o9K9i981095017@wwwmaster.postgresql.org> Comments: In-reply-to "Aleksandr Dushein" message dated "Wed, 20 Oct 2010 09:44:09 +0000" Date: Wed, 20 Oct 2010 12:57:16 -0400 Message-ID: <29688.1287593836@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201010/182 X-Sequence-Number: 28472 "Aleksandr Dushein" writes: > Description: Cannot start postgres (FATAL: invalid cache id: 19) > Hello. I was upgraded my database from 8.4.4 то 9.0.1 one week ago by > pg_dump/pg_restore. Yesterday database stop responding with message ERROR: > database is not accepting commands to avoid wraparound data loss > I trying to restart in single mode and fail with the same error. Ugh. The "invalid cache id" failure is my fault. You can fix that by applying this patch to 9.0: http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=c98cd9bdb618794643b670c8240c0aad213340c7 after which you'll probably need to do a manual vacuum with a standalone backend before the DB will restart. However, the bigger question is how you got into this state in the first place. Even if you'd had autovacuum turned off, it should have protected you against a wraparound. I suspect that pg_upgrade is failing to preserve datfrozenxid and related values properly. Do you by any chance still have the 8.4 database available for examination? Do you have an idea how many transactions you executed since converting? Bruce: exactly what is pg_upgrade's scheme for getting the right frozenxid values into the new catalogs, anyway? regards, tom lane