CREATE OR REPLACE FUNCTION copy_street_id() RETURNS trigger AS '
 BEGIN
  INSERT INTO object (objectid, objecttypeid) VALUES (new.id, ''street'');
  RETURN NULL;
 END
' LANGUAGE plpgsql;

CREATE TRIGGER copy_street_id_trigger AFTER INSERT ON street FOR EACH ROW EXECUTE PROCEDURE copy_street_id();

CREATE TRIGGER delete_street_id_trigger AFTER DELETE ON street FOR EACH ROW EXECUTE PROCEDURE delete_id();

