Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Creates a simple table and attaches a trigger function that just sleeps 1s
create table t1(c1 int);
CREATE OR REPLACE FUNCTION public.t1_upd()
RETURNS trigger
LANGUAGE plpgsql
AS $function$
begin
perform pg_sleep(1);
return new;
end;
$function$;
create trigger t1_upd_trg after update or insert on t1 for each row execute procedure t1_upd();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.