Re: FATAL: catalog is missing 1 attribute(s) for relid - Mailing list pgsql-hackers

From Mark Kirkwood
Subject Re: FATAL: catalog is missing 1 attribute(s) for relid
Date
Msg-id 41E76C34.8020005@coretech.co.nz
Whole thread Raw
In response to Re: FATAL: catalog is missing 1 attribute(s) for relid  (Mark Kirkwood <markir@coretech.co.nz>)
List 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




pgsql-hackers by date:

Previous
From: Ron Mayer
Date:
Subject: Re: Top-k optimizations?
Next
From: "Marc G. Fournier"
Date:
Subject: Re: FATAL: catalog is missing 1 attribute(s) for relid