Skip to content

Instantly share code, notes, and snippets.

@iacovlev-pavel
Last active March 30, 2021 17:39
Show Gist options
  • Save iacovlev-pavel/5dfd4007b701586de8ea7a782d59c633 to your computer and use it in GitHub Desktop.
Save iacovlev-pavel/5dfd4007b701586de8ea7a782d59c633 to your computer and use it in GitHub Desktop.
tst_postrau_change.sql
CREATE OR REPLACE FUNCTION giscuit_layers.tst_postrau_change() RETURNS TRIGGER AS $$
BEGIN
NEW.the_geom := (SELECT the_geom FROM giscuit_layers.tst_postrau WHERE tst_postrau.gid = NEW.postraugid);
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
DROP TRIGGER IF EXISTS tst_postrau_change ON giscuit_layers.tst_dtpstrau_map;
CREATE TRIGGER tst_postrau_change BEFORE UPDATE ON giscuit_layers.tst_dtpstrau_map FOR EACH ROW EXECUTE PROCEDURE giscuit_layers.tst_postrau_change();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment