I have created a table score and also created a function and a trigger along with it.
CREATE TABLE scores(
--fields
);
CREATE FUNCTION scores_before_save() RETURNS trigger AS $$
BEGIN
-- function logic
END;
$$ LANGUAGE plpgsql;
CREATE TRIGGER scores_before_save BEFORE INSERT OR UPDATE ON scores
FOR EACH ROW EXECUTE PROCEDURE scores_before_save();
Now, I dropped this table
DROP TABLE scores;
So my question is that are triggers and functions automatically deleted once we delete the table or we need to manually delete them ?
You can easily check them
as you can see, after drop table, function stays here, but trigger is removed.