1 -- SPDX-License-Identifier: GPL-2.0-only
3 -- This file is part of Nominatim. (https://nominatim.org)
5 -- Copyright (C) 2026 by the Nominatim developer community.
6 -- For a full list of authors see the git log.
8 -- Trigger functions for associated street relations.
11 -- Invalidates house members of associatedStreet relations
12 -- whenever the place_associated_street table is modified.
13 -- osm2pgsql flex handles updates as DELETE-all + re-INSERT, so each
14 -- row-level trigger call covers exactly one member.
15 CREATE OR REPLACE FUNCTION invalidate_associated_street_members()
21 IF TG_OP = 'DELETE' THEN
27 IF object.member_role = 'house' THEN
28 {% for otype in ('N', 'W', 'R') %}
29 IF object.member_type = '{{ otype }}' THEN
30 UPDATE placex SET indexed_status = 2
31 WHERE osm_type = '{{ otype }}'
32 AND osm_id = object.member_id
33 AND indexed_status = 0;