Re: database corruption - Mailing list pgsql-hackers

From Joe Conway
Subject Re: database corruption
Date
Msg-id 3F5101A6.2070000@joeconway.com
Whole thread Raw
In response to database corruption  (Joe Conway <mail@joeconway.com>)
Responses Re: database corruption
List 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




pgsql-hackers by date:

Previous
From: Hans-Jürgen Schönig
Date:
Subject: Is it a memory leak in PostgreSQL 7.4beta?
Next
From: Alvaro Herrera
Date:
Subject: Re: database corruption