0

I had an issue with my database where I accidentally had 1000s of duplicate fkey constraints. I managed to find them & deleted directly from pg_constraint (I think this is where I messed up but it's too late now).

My data is all still there & the constraints I want but now the database spews "cache lookup failed for constraint".

What are my options here?

Is there anyway to repair the database? Do I just need to somehow get all my data out & restore a new database.

user3818491
  • 498
  • 1
  • 6
  • 16

1 Answers1

0

Only way that I could find was dumping the database & restoring a fresh one.

user3818491
  • 498
  • 1
  • 6
  • 16
  • Valuable lesson here. NEVER for any reason what-so-ever update system tables (pg_...) directly. You might be able to get a valid DB state by bouncing the server. But that could also result in a DB that cannot be restarted. Get all your data out somehow (if you can). And try it afterward. You may however to restore form an old backup. Hope you have one. – Belayer Apr 16 '20 at 23:11