Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
487 B
7
Indexable
Never
CREATE OR REPLACE FUNCTION public.simple_trigger_test() RETURNS TRIGGER AS $$
BEGIN
    INSERT INTO public.debug_log(message) VALUES ('Simple trigger test executed.');
    RETURN NEW;
END;
$$ LANGUAGE plpgsql SECURITY DEFINER;

-- Make sure to drop the existing trigger before creating a new one
DROP TRIGGER IF EXISTS simple_test_trigger ON stripe.invoices;

CREATE TRIGGER simple_test_trigger
AFTER INSERT ON stripe.invoices
FOR EACH ROW
EXECUTE FUNCTION public.simple_trigger_test();
Leave a Comment