Updating committee name based on a spatial join within a trigger in Postgis. It appears right to me and it runs and executes successfully but still comes up with an error when I try to create a new feature.
CREATE OR REPLACE FUNCTION tf_committee() RETURNS trigger AS $BODY$ BEGIN NEW.committee := c.committee_name FROM housing_development_prospectus.committee as hdp, committee.committee_name as c WHERE hdp.wkb_geometry && NEW.wkb_geometry AND ST_Intersects(NEW.wkb_geometry, c.wkb_geometry); RETURN NEW; END; $BODY$
أكثر...
CREATE OR REPLACE FUNCTION tf_committee() RETURNS trigger AS $BODY$ BEGIN NEW.committee := c.committee_name FROM housing_development_prospectus.committee as hdp, committee.committee_name as c WHERE hdp.wkb_geometry && NEW.wkb_geometry AND ST_Intersects(NEW.wkb_geometry, c.wkb_geometry); RETURN NEW; END; $BODY$
أكثر...