N
Neon5mo ago
other-emerald

Cancel query

What: I'm trying to cancel a query that's been running for many hours now but with no success. Why: I'm trying to remove a table trigger but it doesn't complete. I suppose I can't remove a trigger when there's an active query related to it How: I've tried a few things with no success so far: 1. In Neon's dashboard I click the menu option (Monitoring -> Active Queries -> Query options -> Cancel query) and nothing happens. 2. Tried running "select pg_terminate_backend(PID)" and, although it returns true meaning that the request was received, it doesn't terminate 3. Tried running "select pg_cancel_backend(PID)" and had the same result as #2 4. DROP TRIGGER also runs indefinitely The problem is an insert in a table that contains a trigger. This trigger runs a function that calls an extension (rag_bge_small_en_v15.embedding_for_passage()). I tried calling the extension in a separate query and the query doesn't finish (it runs forever), so that shows me that the problem is there.
2 Replies
sensitive-blue
sensitive-blue5mo ago
@Jean Lustosa Does running the following helps? ALTER TABLE your_table DISABLE TRIGGER your_trigger; If not, you'd want to do an endpoint restart.
other-emerald
other-emeraldOP4mo ago
I restarted the endpoint. Thank you @Rishi Raj Jain In any case, how can we debug to find out what was the root case? I don't know if I should continue using the extension because I'm not sure what the real problem was

Did you find this page helpful?