Error: "catalog is missing 8 attribute(s) for relid 16683"

From: "Alexandru Coseru" <alex_spam(at)distinctgroup(dot)net>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Error: "catalog is missing 8 attribute(s) for relid 16683"
Date: 2005-03-02 14:41:25
Message-ID: 013701c51f35$e951ff40$87618ac1@alex2
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello..
I've got this error and I don't know how to fix it.
Since it's an production database , I can't drop & recreate it..

Here are some infos below..

[root(at)gw gateway]# psql -U postgres -h 127.0.0.1 template1
Welcome to psql 7.4.5, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit
template1=# \dt
ERROR: catalog is missing 8 attribute(s) for relid 16683
template1=# VACUUM FULL;
ERROR: catalog is missing 3 attribute(s) for relid 16656

There is some data in pg_attribute :
template1=# select * from pg_attribute LIMIT 3;
attrelid | attname | atttypid | attstattarget | attlen | attnum | attndims | attcacheoff | atttypmod | attbyval | attstorage | attisset | attalign | attnotnull | atthasdef | attisdropped | attislocal | attinhcount
----------+--------------+----------+---------------+--------+--------+----------+-------------+-----------+----------+------------+----------+----------+------------+-----------+--------------+------------+-------------
1247 | typname | 19 | -1 | 64 | 1 | 0 | -1 | -1 | f | p | f | i | t | f | f | t | 0
1247 | typnamespace | 26 | -1 | 4 | 2 | 0 | -1 | -1 | t | p | f | i | t | f | f | t | 0
1247 | typowner | 23 | -1 | 4 | 3 | 0 | -1 | -1 | t | p | f | i | t | f | f | t | 0
(3 rows)

but non for relid 16683
template1=# select * from pg_attribute where attrelid=16683;
attrelid | attname | atttypid | attstattarget | attlen | attnum | attndims | attcacheoff | atttypmod | attbyval | attstorage | attisset | attalign | attnotnull | atthasdef | attisdropped | attislocal | attinhcount
----------+---------+----------+---------------+--------+--------+----------+-------------+-----------+----------+------------+----------+----------+------------+-----------+--------------+------------+-------------
(0 rows)

i've tried an pg_dump:

[root(at)gw gateway]# pg_dump -U mydata -h 127.0.0.1 mydata > data.sql
pg_dump: SQL command failed
pg_dump: Error message from server: ERROR: catalog is missing 8 attribute(s) for relid 16683
pg_dump: The command was: SELECT (SELECT usename FROM pg_user WHERE usesysid = datdba) as dba, pg_encoding_to_char(encoding) as encoding, datpath FROM pg_database WHERE datname = 'mydata'

The table affected is pg_user:

[root(at)gw root]# oid2name -H 127.0.0.1 -U mydata -d mydata -o 16683
Tablename of oid 16683 from database "mydata":
---------------------------------
16683 = pg_user
[root(at)gw root]# oid2name -H 127.0.0.1 -U mydata -d mydata -o 16656
Tablename of oid 16656 from database "mydata":
---------------------------------
16656 = pg_toast_16384
[root(at)gw root]# oid2name -H 127.0.0.1 -U mydata -d mydata -o 16384
Tablename of oid 16384 from database "mydata":
---------------------------------
16384 = pg_attrdef

Any select from pg_user fails..

template1=# select * from pg_user;
ERROR: catalog is missing 8 attribute(s) for relid 16683

Even after REINDEX

template1=# reindex table pg_attribute;
REINDEX
template1=# REINDEX INDEX pg_attribute_relid_attnum_index;
REINDEX

template1=# select * from pg_user;
ERROR: catalog is missing 8 attribute(s) for relid 16683

Any ideeas ?

Thanks
Alex

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephane Bortzmeyer 2005-03-02 14:43:13 [Auth] "ident" method and LDAP user accounts
Previous Message Bernt Andreas Drange 2005-03-02 14:28:25 Re: Database Name