Re: FATAL: catalog is missing 1 attribute(s) for relid

From: Mark Kirkwood <markir(at)coretech(dot)co(dot)nz>
To: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: FATAL: catalog is missing 1 attribute(s) for relid
Date: 2005-01-14 06:52:36
Message-ID: 41E76C34.8020005@coretech.co.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Marc,

In case you don't work out a better way to sort this, I can reproduce
and fix the error 'catalog is missing n attribute(s) for relid 16396'
caused by directly deleting (part of) pg_attribute:

Setup :

$ initdb
$ pg_ctl start
$ createdb test

Backup :

$ pg_ctl stop
$ tar -czvf pgdata.tar.gz pgdata

Break :

$ pg_ctl start
$ psql -d test -c "delete from pg_attribute where attrelid=16396"
$ psql test [gets FATAL catalog is missing 20 attribute(s) for relid 16396]

Fix (restore pg_attribute to database test):

$ pg_ctl stop
$ tar -zxvf pgdata.tar.gz pgdata/base/17142/1249
$ pg_ctl start
$ psql test [now works]

The caveat is that any relations created or modified between the backup
and breakage will not be properly restored.

regards

Mark

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2005-01-14 09:28:49 Re: Slow PL/pgSQL 8.0.RC5 (7.4.6. 3times faster)
Previous Message Marc G. Fournier 2005-01-14 05:53:34 Re: FATAL: catalog is missing 1 attribute(s) for relid