Fix SQL failures in transportation_name update code (#1154)

This PR fixed bugs introduced in #1147 and #1119 which broke the update triggers in `transportation_name_update`.  I noticed this issue while I was working a different PR and tried to update a table in the `transportation` layer.

**Test**

The following code currently fails because of cascading update failures, but will complete successfully after this PR is merged.
```
UPDATE osm_highway_linestring hl
    SET network = rm.network_type
    FROM osm_route_member rm
    WHERE hl.osm_id=rm.member;
```
This commit is contained in:
Brian Sperlongano 2021-07-26 09:22:36 -04:00 committed by GitHub
parent b011b27e52
commit 951aa907b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -317,7 +317,7 @@ BEGIN
ELSE NULLIF(hl.ref, '') ELSE NULLIF(hl.ref, '')
END AS ref, END AS ref,
hl.highway, hl.highway,
NULLIF(hl.subclass, '') AS subclass, NULLIF(hl.construction, '') AS subclass,
brunnel(hl.is_bridge, hl.is_tunnel, hl.is_ford) AS brunnel, brunnel(hl.is_bridge, hl.is_tunnel, hl.is_ford) AS brunnel,
CASE WHEN highway IN ('footway', 'steps') THEN layer END AS layer, CASE WHEN highway IN ('footway', 'steps') THEN layer END AS layer,
CASE WHEN highway IN ('footway', 'steps') THEN level END AS level, CASE WHEN highway IN ('footway', 'steps') THEN level END AS level,
@ -498,7 +498,6 @@ BEGIN
INSERT INTO osm_transportation_name_linestring INSERT INTO osm_transportation_name_linestring
SELECT (ST_Dump(geometry)).geom AS geometry, SELECT (ST_Dump(geometry)).geom AS geometry,
NULL::bigint AS osm_id,
name, name,
name_en, name_en,
name_de, name_de,