1

I created the trigger function with the below code:

CREATE OR REPLACE FUNCTION snitch() RETURNS event_trigger AS $$
BEGIN
    select pgr_createTopology('public.roads_noded', 0.001);
END;
$$ LANGUAGE plpgsql;

CREATE EVENT TRIGGER snitch ON ddl_command_start EXECUTE FUNCTION snitch();

It is located in the public schema. Now I want to drop this function but when I try to drop it executes the given function and the server hangs. After restarting the server, the same thing happens. I can't create or drop any table. Is there a way to remove this trigger function?

1 Answer 1

3

The DROP FUNCTION command is itself a DDL command so the trigger will fire. You should first remove the trigger using DROP EVENT TRIGGER, then the function.

Sign up to request clarification or add additional context in comments.

2 Comments

thanks for the response, I tried DROP TRIGGER snitch but it requires a table name. This is an event trigger and not assigned to any table, so, it gives an error without a table name.
The command should be DROP EVENT TRIGGER. Answer updated

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.