Change SELECT to PERFORM in function and drop triggers first
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
DROP TRIGGER IF EXISTS trigger_flag ON osm_island_polygon;
|
||||
DROP TRIGGER IF EXISTS trigger_refresh ON place_island.updates;
|
||||
|
||||
-- etldoc: osm_island_polygon -> osm_island_polygon
|
||||
CREATE OR REPLACE FUNCTION convert_island_polygon_point() RETURNS VOID AS $$
|
||||
BEGIN
|
||||
@@ -24,16 +27,13 @@ CREATE OR REPLACE FUNCTION place_island.refresh() RETURNS trigger AS
|
||||
$BODY$
|
||||
BEGIN
|
||||
RAISE LOG 'Refresh place_island';
|
||||
SELECT convert_island_polygon_point();
|
||||
PERFORM convert_island_polygon_point();
|
||||
DELETE FROM place_island.updates;
|
||||
RETURN null;
|
||||
END;
|
||||
$BODY$
|
||||
language plpgsql;
|
||||
|
||||
DROP TRIGGER IF EXISTS trigger_flag ON osm_island_polygon;
|
||||
DROP TRIGGER IF EXISTS trigger_refresh ON place_island.updates;
|
||||
|
||||
CREATE TRIGGER trigger_flag
|
||||
AFTER INSERT OR UPDATE OR DELETE ON osm_island_polygon
|
||||
FOR EACH STATEMENT
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
DROP TRIGGER IF EXISTS trigger_flag ON osm_city_point;
|
||||
DROP TRIGGER IF EXISTS trigger_refresh ON place_city.updates;
|
||||
|
||||
CREATE EXTENSION IF NOT EXISTS unaccent;
|
||||
|
||||
|
||||
CREATE OR REPLACE FUNCTION update_osm_city_point() RETURNS VOID AS $$
|
||||
BEGIN
|
||||
|
||||
@@ -62,16 +63,13 @@ CREATE OR REPLACE FUNCTION place_city.refresh() RETURNS trigger AS
|
||||
$BODY$
|
||||
BEGIN
|
||||
RAISE LOG 'Refresh place_city rank';
|
||||
SELECT update_osm_city_point();
|
||||
PERFORM update_osm_city_point();
|
||||
DELETE FROM place_city.updates;
|
||||
RETURN null;
|
||||
END;
|
||||
$BODY$
|
||||
language plpgsql;
|
||||
|
||||
DROP TRIGGER IF EXISTS trigger_flag ON osm_city_point;
|
||||
DROP TRIGGER IF EXISTS trigger_refresh ON place_city.updates;
|
||||
|
||||
CREATE TRIGGER trigger_flag
|
||||
AFTER INSERT OR UPDATE OR DELETE ON osm_city_point
|
||||
FOR EACH STATEMENT
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
DROP TRIGGER IF EXISTS trigger_flag ON osm_country_point;
|
||||
DROP TRIGGER IF EXISTS trigger_refresh ON place_country.updates;
|
||||
|
||||
ALTER TABLE osm_country_point DROP CONSTRAINT IF EXISTS osm_country_point_rank_constraint;
|
||||
|
||||
-- etldoc: ne_10m_admin_0_countries -> osm_country_point
|
||||
@@ -57,16 +60,13 @@ CREATE OR REPLACE FUNCTION place_country.refresh() RETURNS trigger AS
|
||||
$BODY$
|
||||
BEGIN
|
||||
RAISE LOG 'Refresh place_country rank';
|
||||
SELECT update_osm_country_point();
|
||||
PERFORM update_osm_country_point();
|
||||
DELETE FROM place_country.updates;
|
||||
RETURN null;
|
||||
END;
|
||||
$BODY$
|
||||
language plpgsql;
|
||||
|
||||
DROP TRIGGER IF EXISTS trigger_flag ON osm_country_point;
|
||||
DROP TRIGGER IF EXISTS trigger_refresh ON place_country.updates;
|
||||
|
||||
CREATE TRIGGER trigger_flag
|
||||
AFTER INSERT OR UPDATE OR DELETE ON osm_country_point
|
||||
FOR EACH STATEMENT
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
DROP TRIGGER IF EXISTS trigger_flag ON osm_state_point;
|
||||
DROP TRIGGER IF EXISTS trigger_refresh ON place_state.updates;
|
||||
|
||||
ALTER TABLE osm_state_point DROP CONSTRAINT IF EXISTS osm_state_point_rank_constraint;
|
||||
|
||||
-- etldoc: ne_10m_admin_1_states_provinces_shp -> osm_state_point
|
||||
@@ -53,16 +56,13 @@ CREATE OR REPLACE FUNCTION place_state.refresh() RETURNS trigger AS
|
||||
$BODY$
|
||||
BEGIN
|
||||
RAISE LOG 'Refresh place_state rank';
|
||||
SELECT update_osm_state_point();
|
||||
PERFORM update_osm_state_point();
|
||||
DELETE FROM place_state.updates;
|
||||
RETURN null;
|
||||
END;
|
||||
$BODY$
|
||||
language plpgsql;
|
||||
|
||||
DROP TRIGGER IF EXISTS trigger_flag ON osm_state_point;
|
||||
DROP TRIGGER IF EXISTS trigger_refresh ON place_state.updates;
|
||||
|
||||
CREATE TRIGGER trigger_flag
|
||||
AFTER INSERT OR UPDATE OR DELETE ON osm_state_point
|
||||
FOR EACH STATEMENT
|
||||
|
||||
Reference in New Issue
Block a user