Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group