Search Postgresql Archives

corrupted table postgresql 8.3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi people!

I have a pg 8.3. Today I issued in a database that comand:
=# ALTER TABLE cliente ADD COLUMN pwd_expired boolean DEFAULT FALSE;
WARNING:  unexpected attrdef record found for attr 22 of rel cliente
WARNING:  unexpected attrdef record found for attr 22 of rel cliente
WARNING:  unexpected attrdef record found for attr 22 of rel cliente
ALTER TABLE
Time: 1184.404 ms

After that the table was empty.

SELECT * from cliente;
0 rows ;)
Should contain about 90k records.

I checked in the logs and there are not disk/memory issues on the server.

If I try to execute a vacuum full I get this error.
ERROR:  could not open relation 1663/36509/28638634: No such file or directory

At this time I saw two entries of table "cliente" in the pg_tables.

At this time I stopped to troubleshoot and tried to plan some tasks to recover the disaster situation.

I recovered the 98% of the data by copying manually the physical data file of the cluster of that table and the clog to another pg server 8.3.
after that in the server where i got that problem I did this:
- renamed the table to cliente_prova
- removed all the foreign key that are pointing to that table
- recreated the table
- populated the table with the production data recovered from the other server (the last 3-4 fields of the table was unreadable, but I don't know if the method that I used to "recover" the table was technically correct... It was a try...)
- all up and running again

Now i'm facing this:
- if I type \d cliente, I see the schema twice, one without the field "pwd_expired" and the right one that is without it (the table that I restored)
- unable to drop the table renamed cliente_prova
=# DROP TABLE cliente_prova;
WARNING:  unexpected attrdef record found for attr 22 of rel cliente_prova
WARNING:  unexpected attrdef record found for attr 22 of rel cliente_prova
WARNING:  unexpected attrdef record found for attr 22 of rel cliente_prova
WARNING:  unexpected attrdef record found for attr 22 of rel cliente_prova
NOTICE:  default for table cliente column id depends on sequence cliente_id_seq
WARNING:  unexpected attrdef record found for attr 22 of rel cliente_prova
WARNING:  unexpected attrdef record found for attr 22 of rel cliente_prova
WARNING:  unexpected attrdef record found for attr 22 of rel cliente_prova
WARNING:  unexpected attrdef record found for attr 22 of rel cliente_prova
WARNING:  unexpected attrdef record found for attr 22 of rel cliente_prova
WARNING:  unexpected attrdef record found for attr 22 of rel cliente_prova
WARNING:  unexpected attrdef record found for attr 22 of rel cliente_prova
ERROR:  cannot drop table cliente_prova because other objects depend on it
HINT:  Use DROP ... CASCADE to drop the dependent objects too.

I'll stop here to describe further detail... can you suppose what is happened please? 
After that can we discuss how to cleanup the situation...;)

Thanks a lot!

Matteo

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux