Change SELECT to PERFORM in function and drop triggers first

This commit is contained in:
stirringhalo
2017-01-06 20:33:43 -05:00
parent b58d80ce44
commit cda3af9215
10 changed files with 30 additions and 37 deletions

View File

@@ -1,3 +1,5 @@
DROP TRIGGER IF EXISTS trigger_flag ON osm_housenumber_point;
DROP TRIGGER IF EXISTS trigger_refresh ON housenumber.updates;
-- etldoc: osm_housenumber_point -> osm_housenumber_point
CREATE OR REPLACE FUNCTION convert_housenumber_point() RETURNS VOID AS $$
@@ -24,16 +26,13 @@ CREATE OR REPLACE FUNCTION housenumber.refresh() RETURNS trigger AS
$BODY$
BEGIN
RAISE LOG 'Refresh housenumber';
SELECT convert_housenumber_point();
PERFORM convert_housenumber_point();
DELETE FROM housenumber.updates;
RETURN null;
END;
$BODY$
language plpgsql;
DROP TRIGGER IF EXISTS trigger_flag ON osm_housenumber_point;
DROP TRIGGER IF EXISTS trigger_refresh ON housenumber.updates;
CREATE TRIGGER trigger_flag
AFTER INSERT OR UPDATE OR DELETE ON osm_housenumber_point
FOR EACH STATEMENT