Skip to content

Instantly share code, notes, and snippets.

@QiMata
Created June 18, 2020 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save QiMata/45d698713e5f703af246e8eef7c16f1a to your computer and use it in GitHub Desktop.
Save QiMata/45d698713e5f703af246e8eef7c16f1a to your computer and use it in GitHub Desktop.
Trigger for insert into logging table
create function address_trigger_function()
returns trigger as $$
BEGIN
insert into logging_address_address (address_id, type, street1, street2, street3, street4, city, po_box_code, phone_number, date_created, operation)
values (old.address_id, old.type, old.street1,old.street2,old.street3,old.street4,old.city,old.po_box_code,old.phone_number, old.date_created,TG_OP);
RETURN NEW;
end;
$$ LANGUAGE plpgsql;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment