Re: database corruption

From: Joe Conway <mail(at)joeconway(dot)com>
To:
Cc: "Hackers (PostgreSQL)" <pgsql-hackers(at)postgresql(dot)org>, Lance Rushing <rushing(at)armornetworks(dot)com>
Subject: Re: database corruption
Date: 2003-08-30 19:57:26
Message-ID: 3F5101A6.2070000@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Joe Conway wrote:
> I don't have any more detail yet on exactly what he was doing at this
> point, but I grabbed a copy of $PGDATA and looked at it on my own
> machine (since he doesn't have debug and assert support). Logging into
> any other database works fine, but the offending database produces this
> backtrace:

It turns out the "corruption" was user error. He ran a statement that
inadvertantly set reltriggers = 1 for every row in pg_class. This is
what led to the infinite recursion.

For the archives, I was able to hack my way into the database by
wrapping the body of RelationBuildTriggers() in "if (relation->rd_id >
17000) {}", thus excluding system tables. Once back in the database,
updating reltriggers in pg_class to appropriate values restored access
to the database with an unhacked backend.

Joe

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2003-08-30 20:04:40 Re: database corruption
Previous Message Thomas Swan 2003-08-30 18:41:41 Re: ALTER TABLE ... TO ... to change related names