Thread: Query failed: ERROR: catalog is missing 1 attribute(s) for relid 456086
Everything was working fine with a site of mine yesterday, but today PG was failing with: Warning: pg_query() [function.pg-query]: Query failed: ERROR: catalog is missing 1 attribute(s) for relid 456086 . in /var/www/html/lib.php on line 200 VACUUM gave the same error, but VACUUM FULL appears to have fixed whatever the problem was. Only one of the PG databases was giving this error. Any idea what the problem was/is? I'm using PG 7.3.2 and run the vacuumdb script nightly. __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com
CSN <cool_screen_name90001@yahoo.com> writes: > ERROR: catalog is missing 1 attribute(s) for relid > 456086 . in /var/www/html/lib.php on line 200 Ugh. This indicates corruption in the system catalogs --- specifically, a missing pg_attribute row. These rows will normally be picked up with an indexscan, so it's possible that pg_attribute itself is fine and the trouble is corruption in pg_attribute_relid_attnum_index. > VACUUM gave the same error, but VACUUM FULL appears to > have fixed whatever the problem was. Sounds like blind luck to me. I'd have expected that you *might* escape alive by reindexing pg_attribute, otherwise you have a big problem. The only way that an error like that would go away by itself is if it wasn't really there at all --- that is, the apparent corruption only existed in in-memory copies of pg_attribute pages, and not on disk at all. I'd strongly recommend running some hardware diagnostics (memtest86, badblocks, etc). You might not be so lucky with the next dropped bit. regards, tom lane
> otherwise you have a big problem. Is this something that's likely to occur again (and again)? How *big* of a problem would/could it cause (corrupted table, db, installation, ...)? Also, how would it be recovered from (backups, reindexing, vacuum, ...)? I'll have to see about running the memory tests. If it does turn out there's bad memory, is replacing it the only recourse? Thanks, CSN --- Tom Lane <tgl@sss.pgh.pa.us> wrote: > CSN <cool_screen_name90001@yahoo.com> writes: > > ERROR: catalog is missing 1 attribute(s) for relid > > 456086 . in /var/www/html/lib.php on line 200 > > Ugh. This indicates corruption in the system > catalogs --- specifically, > a missing pg_attribute row. These rows will > normally be picked up with an > indexscan, so it's possible that pg_attribute itself > is fine and the > trouble is corruption in > pg_attribute_relid_attnum_index. > > > VACUUM gave the same error, but VACUUM FULL > appears to > > have fixed whatever the problem was. > > Sounds like blind luck to me. I'd have expected > that you *might* escape > alive by reindexing pg_attribute, otherwise you have > a big problem. > > The only way that an error like that would go away > by itself is if it > wasn't really there at all --- that is, the apparent > corruption only > existed in in-memory copies of pg_attribute pages, > and not on disk at > all. I'd strongly recommend running some hardware > diagnostics > (memtest86, badblocks, etc). You might not be so > lucky with the next > dropped bit. > > regards, tom lane __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com