G
Size: a a a
F
ДT
Л
SN
ДT
G
F
ДМ
CREATE OR REPLACE FUNCTION public.increment_updated_times()
RETURNS trigger
LANGUAGE plpgsql
AS $function$
begin
after update on public.contacts
if
old.contact_name= new company and
old.company = new.company and
old.contact_group = new.contact_group and
old.email = new.email and
old.account_name = new.account_name and
old.job_title = new.job_title then
new.updated_times = old.updated_times+1;
return new;
END;
$function$
ДМ
IK
ДМ
IK
ДМ
ДМ
ДМ
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;
END;
$function$