Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1THd32-0004PJ-Nm for pgsql-bugs@postgresql.org; Fri, 28 Sep 2012 16:04:16 +0000 Received: from ch-smtp05.sth.basefarm.net ([80.76.153.6]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1THd30-0006vt-Lx for pgsql-bugs@postgresql.org; Fri, 28 Sep 2012 16:04:16 +0000 Received: from c83-251-133-196.bredband.comhem.se ([83.251.133.196]:31090 helo=[10.100.0.2]) by ch-smtp05.sth.basefarm.net with esmtp (Exim 4.77) (envelope-from ) id 1THd2r-000200-Hs; Fri, 28 Sep 2012 18:04:11 +0200 Message-ID: <5065CA70.7010500@mksoft.nu> Date: Fri, 28 Sep 2012 18:04:00 +0200 From: =?ISO-8859-1?Q?Mikael_Kjellstr=F6m?= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Tom Lane CC: pgsql-bugs@postgresql.org Subject: Re: Corrupt view in PostgreSQL 9.0.9 References: <5065AFAB.1030305@mksoft.nu> <22618.1348842939@sss.pgh.pa.us> In-Reply-To: <22618.1348842939@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: 83.251.133.196 X-Scan-Result: No virus found in message 1THd2r-000200-Hs. X-Scan-Signature: ch-smtp05.sth.basefarm.net 1THd2r-000200-Hs 1a5ba3c0b3f29ee816214ea4e3a6f5e2 X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201209/297 X-Sequence-Number: 34291 On 2012-09-28 16:35, Tom Lane wrote: > =?ISO-8859-1?Q?Mikael_Kjellstr=F6m?= writes: >> # drop view communitytaxiexceptions ; >> ERROR: invalid attribute number 0 for communitytaxiexceptions > > That's pretty odd --- it implies something nasty has happened to the > contents of pg_attribute. It would be interesting to have a look at > select * from pg_attribute where attrelid = 'communitytaxiexceptions'::regclass; Here is the result of the above query, I hope it's readable and not mangled: # select * from pg_attribute where attrelid = 'communitytaxiexceptions'::regclass; attrelid | attname | atttypid | attstattarget | attlen | attnum | attndims | attcacheoff | atttypmod | attbyva l | attstorage | attalign | attnotnull | atthasdef | attisdropped | attislocal | attinhcount | attacl | attoptions ----------+------------------+----------+---------------+--------+--------+----------+-------------+-----------+-------- --+------------+----------+------------+-----------+--------------+------------+-------------+--------+------------ 16547 | commun | 25 | -1 | -1 | 1 | 0 | -1 | -1 | f | x | i | f | f | f | t | 0 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 16547 | unda | 0 | 700 | 0 | 0 | 0 | 2883584 | 1245245 | t | | | t | t | t | f | 0 | | 16547 | undantagid | 25 | -1 | -1 | 6 | 0 | -1 | -1 | f | x | i | f | f | f | t | 0 | | 16547 | numbernamn | 25 | -1 | -1 | 7 | 0 | -1 | -1 | f | x | i | f | f | f | t | 0 | | 16547 | telenummer | 25 | -1 | -1 | 8 | 0 | -1 | -1 | f | x | i | f | f | f | t | 0 | | 16547 | distributionname | 25 | -1 | -1 | 9 | 0 | -1 | -1 | f | x | i | f | f | f | t | 0 | | 16547 | zoneid | 23 | -1 | 4 | 10 | 0 | -1 | -1 | t | p | i | f | f | f | t | 0 | | (10 rows) >> Is there anything thing I could do to manually remove the view or fix >> the problem? > > Well, you could manually remove its pg_class and pg_type rows, and that > should be close enough to being "gone". But what I'm worried about is > what other damage there is. Yes, that is what I am afraid of also. We had a nasty power spike and that caused the machine to reboot. The raid controller is equipped with a BBU though so there shouldn't be any lost disk writes. But you never know. Any point of running a vacuum full on the database or is that a bad idea? /Mikael