ДМ
Size: a a a
ДМ
ДМ
SC
ДМ
ДМ
ДМ
create trigger increment_trigger after
update
on
public.contacts for each row execute function increment_updated_times()
ДМ
YS
create trigger increment_trigger after
update
on
public.contacts for each row execute function increment_updated_times()
ДМ
ДМ
CREATE OR REPLACE FUNCTION public.increment_updated_times()
RETURNS trigger
LANGUAGE plpgsql
AS $function$
begin
if
old.contact_name <> new.contact_name or
old.company <> new.company or
old.contact_group <> new.contact_group or
old.email <> new.email or
old.account_name <> new.account_name or
old.job_title <> new.job_title then
new.updated_times = old.updated_times+1;
return new;
end if;
raise notice 'Hello world';
return new;
END;
$function$
;
ДМ
YS
CREATE OR REPLACE FUNCTION public.increment_updated_times()
RETURNS trigger
LANGUAGE plpgsql
AS $function$
begin
if
old.contact_name <> new.contact_name or
old.company <> new.company or
old.contact_group <> new.contact_group or
old.email <> new.email or
old.account_name <> new.account_name or
old.job_title <> new.job_title then
new.updated_times = old.updated_times+1;
return new;
end if;
raise notice 'Hello world';
return new;
END;
$function$
;
ДМ
IZ
ДМ
ВТ
create trigger increment_trigger after
update
on
public.contacts for each row execute function increment_updated_times()
ДМ
ВТ
CREATE OR REPLACE FUNCTION public.increment_updated_times()
RETURNS trigger
LANGUAGE plpgsql
AS $function$
begin
if
old.contact_name <> new.contact_name or
old.company <> new.company or
old.contact_group <> new.contact_group or
old.email <> new.email or
old.account_name <> new.account_name or
old.job_title <> new.job_title then
new.updated_times = old.updated_times+1;
return new;
end if;
raise notice 'Hello world';
return new;
END;
$function$
;
ДМ