Last active
June 13, 2016 14:29
-
-
Save kmoppel/f8560495f387ae5394e9e523c854fe87 to your computer and use it in GitHub Desktop.
Creates a simple table and attaches a trigger function that just sleeps 1s
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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