79466996

Date: 2025-02-25 15:08:04
Score: 1.5
Natty:
Report link

This happened to me.

What I noticed is that there were processes running that simply wouldn't let me execute DROP TABLE or ALTER TABLE on the PK or FK.

First I did:

SELECT * FROM pg_stat_activity

I didn't filter by just the active ones because the ones that were blocking were in "idle" status

And then I killed those processes:

SELECT pg_cancel_backend(<pid of the process>)

I killed all the processes that were running for that database. I made sure that this wouldn't affect my application.

Link : How to stop/kill a query in postgresql?

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (0.5):
Posted by: Ernandes Junior