Attribute number 10 exceeds number of columns 0

前端 未结 1 1156
慢半拍i
慢半拍i 2021-01-24 19:05

This query returns all the rows(around 850+) from the table successfully:

select * from my_db_log
 where date_trunc(\'day\',creation_date) >= to_date(\'2014-0         


        
相关标签:
1条回答
  • 2021-01-24 19:43

    Something is broken in your database. Try

    VACCUM FULL ANALYZE my_db_log;
    

    Or, more radically, run from the shell on your db server:

    vacuumdb --full --analyze my_database
    

    Details in the manual.

    The error message indicate breakage in the system catalog pg_attribute or one of the associated indices. Before you do anything else, read about corruption in the Postgres Wiki. Be very careful not to lose valuable data.
    Then one other thing to try:

    reindexdb --system my_database
    

    If nothing helps, to repair your obviously broken DB, you could try to pg_dumpall the whole cluster, drop the cluster, create a new cluster and restore the backup. Also make sure you find out what broke your db. That does not usually happen (never happened to me, yet). Chances are, you are facing serious hardware problems, in which case you need to act soon ...

    0 讨论(0)
提交回复
热议问题