Re: Data problem - error "invalid attribute number # for <tablename>"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Sebastien Boisvert <sebastienboisvert(at)yahoo(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Data problem - error "invalid attribute number # for <tablename>"
Date: 2009-09-28 20:20:49
Message-ID: 13973.1254169249@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Sebastien Boisvert <sebastienboisvert(at)yahoo(dot)com> writes:
> We've received a client's database which was giving errors and refusing to be backed up; at this point we do not know what's happened to the database to corrupt it (likely a hardware or power failure, etc.)
> The error that is being given when trying to do selects on the affected table or doing a pg_dump is:

> ERROR: invalid attribute number 32533 for largedata

Some poking through the source code finds only one match for that error
message, which is in relcache.c. It looks like you have a row in
pg_attribute that claims to belong to that relation, but has attnum
32533. It would be interesting to see the results for
select * from pg_attribute where attrelid = 'largedata'::regclass

What PG version is this exactly, on what platform?

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Jakub Gołębiewski 2009-09-29 12:57:11 Postgresql 8.4 pam
Previous Message Sebastien Boisvert 2009-09-28 19:26:07 Data problem - error "invalid attribute number # for <tablename>"