We have a UPS failure and our database is corrupted
I can connect to postgres-xl itself , but we have many error when running query
I must have 28 tables but currently pgAdmin show I have only 21 table , I check that some tables in not listed in pgAdmin but exists in pg_class
, some is not exist both pgAdmin and pg_class
It is also strange that if I select all records of pg_class
I can see my_table
is listed in returned result but when I run select * from pg_class where relname='my_table'
I have no record (It is no case-sensitive my_table miss typing)
Another error is
ERROR: could not open file "base/13303/18834": No such file or directory
Sometimes I get this error
ERROR: could not open relation with OID 19826
I run ANALYZE VERBOSE "my_table"
SQL Error [23505]: ERROR: duplicate key value violates unique constraint "pg_statistic_relid_att_inh_index" Detail: Key (starelid, staattnum, stainherit)=(18755, 1, f) already exists.
org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "pg_statistic_relid_att_inh_index" Detail: Key (starelid, staattnum, stainherit)=(18755, 1, f) already exists.
So I run this query
select starelid,staattnum,stainherit,count(*) cnt from pg_statistic group by starelid,staattnum,stainherit having count(1) >1 order by 1,2,3;
I don't know how I have duplicate key value violates but the query result is empty and there is no duplicate record
Another issue is
ERROR:relation "public.my_table" does not exist PANIC:cannot abort transaction 212004, it was already committed server closed the connection unexpectedly This probably means the server terminated abnormally