when create materialized do so without data, better logging
This commit is contained in:
@@ -16,7 +16,7 @@ CREATE MATERIALIZED VIEW osm_important_waterway_linestring AS (
|
||||
WHERE name <> '' AND waterway = 'river'
|
||||
GROUP BY name
|
||||
) AS waterway_union
|
||||
);
|
||||
) WITH NO DATA;
|
||||
CREATE INDEX IF NOT EXISTS osm_important_waterway_linestring_geometry_idx ON osm_important_waterway_linestring USING gist(geometry);
|
||||
|
||||
-- etldoc: osm_important_waterway_linestring -> osm_important_waterway_linestring_gen1
|
||||
@@ -24,7 +24,7 @@ CREATE MATERIALIZED VIEW osm_important_waterway_linestring_gen1 AS (
|
||||
SELECT ST_Simplify(geometry, 60) AS geometry, name
|
||||
FROM osm_important_waterway_linestring
|
||||
WHERE ST_Length(geometry) > 1000
|
||||
);
|
||||
) WITH NO DATA;
|
||||
CREATE INDEX IF NOT EXISTS osm_important_waterway_linestring_gen1_geometry_idx ON osm_important_waterway_linestring_gen1 USING gist(geometry);
|
||||
|
||||
-- etldoc: osm_important_waterway_linestring_gen1 -> osm_important_waterway_linestring_gen2
|
||||
@@ -32,7 +32,7 @@ CREATE MATERIALIZED VIEW osm_important_waterway_linestring_gen2 AS (
|
||||
SELECT ST_Simplify(geometry, 100) AS geometry, name
|
||||
FROM osm_important_waterway_linestring_gen1
|
||||
WHERE ST_Length(geometry) > 4000
|
||||
);
|
||||
) WITH NO DATA;
|
||||
CREATE INDEX IF NOT EXISTS osm_important_waterway_linestring_gen2_geometry_idx ON osm_important_waterway_linestring_gen2 USING gist(geometry);
|
||||
|
||||
-- etldoc: osm_important_waterway_linestring_gen2 -> osm_important_waterway_linestring_gen3
|
||||
@@ -40,7 +40,7 @@ CREATE MATERIALIZED VIEW osm_important_waterway_linestring_gen3 AS (
|
||||
SELECT ST_Simplify(geometry, 200) AS geometry, name
|
||||
FROM osm_important_waterway_linestring_gen2
|
||||
WHERE ST_Length(geometry) > 8000
|
||||
);
|
||||
) WITH NO DATA;
|
||||
CREATE INDEX IF NOT EXISTS osm_important_waterway_linestring_gen3_geometry_idx ON osm_important_waterway_linestring_gen3 USING gist(geometry);
|
||||
|
||||
--- Triggers
|
||||
@@ -48,6 +48,7 @@ CREATE INDEX IF NOT EXISTS osm_important_waterway_linestring_gen3_geometry_idx O
|
||||
CREATE OR REPLACE FUNCTION refresh_osm_important_waterway_linestring() RETURNS trigger AS
|
||||
$BODY$
|
||||
BEGIN
|
||||
RAISE LOG 'Refresh osm_waterway_linestring based tables';
|
||||
REFRESH MATERIALIZED VIEW osm_important_waterway_linestring;
|
||||
REFRESH MATERIALIZED VIEW osm_important_waterway_linestring_gen1;
|
||||
REFRESH MATERIALIZED VIEW osm_important_waterway_linestring_gen2;
|
||||
|
||||
Reference in New Issue
Block a user