Revision 5545
Added by Aaron Marcuse-Kubitza about 12 years ago
schemas/vegbien.sql | ||
---|---|---|
4769 | 4769 |
-- Name: place_update_ancestors; Type: TRIGGER; Schema: public; Owner: - |
4770 | 4770 |
-- |
4771 | 4771 |
|
4772 |
CREATE TRIGGER place_update_ancestors AFTER INSERT OR UPDATE ON place FOR EACH ROW EXECUTE PROCEDURE place_update_ancestors();
|
|
4772 |
CREATE CONSTRAINT TRIGGER place_update_ancestors AFTER INSERT OR UPDATE ON place DEFERRABLE INITIALLY DEFERRED FOR EACH ROW EXECUTE PROCEDURE place_update_ancestors();
|
|
4773 | 4773 |
|
4774 | 4774 |
|
4775 | 4775 |
-- |
... | ... | |
4811 | 4811 |
-- Name: taxonconcept_update_ancestors; Type: TRIGGER; Schema: public; Owner: - |
4812 | 4812 |
-- |
4813 | 4813 |
|
4814 |
CREATE TRIGGER taxonconcept_update_ancestors AFTER INSERT OR UPDATE ON taxonconcept FOR EACH ROW EXECUTE PROCEDURE taxonconcept_update_ancestors();
|
|
4814 |
CREATE CONSTRAINT TRIGGER taxonconcept_update_ancestors AFTER INSERT OR UPDATE ON taxonconcept DEFERRABLE INITIALLY DEFERRED FOR EACH ROW EXECUTE PROCEDURE taxonconcept_update_ancestors();
|
|
4815 | 4815 |
|
4816 | 4816 |
|
4817 | 4817 |
-- |
Also available in: Unified diff
schemas/vegbien.sql: *_update_ancestors(): Made trigger deferred, so that it would run after all rows have been inserted in a bulk insert, such as during column-based import. This ensures that ancestors lists are not populated until all parents are inserted, which may occur out of order for datasources (such as NCBI) whose nodes are not in dependency order. (A node that newly acquires a parent will have to update all its descendants, which will then be updated again when its parent acquires its own parent.)