 		tag.name,
 		handover_relation.direction ) t
     LEFT JOIN gis.handoverrelation_tags ON handoverrelation_tags.entity_id = t.handover_id
-
-
 $BODY$
   LANGUAGE sql STABLE
   COST 100

GRANT ALL ON TABLE gis.handoverrelation_tags TO minerva_admin;
GRANT SELECT ON TABLE gis.handoverrelation_tags TO minerva;


CREATE TYPE gis.existence_change AS (exists boolean, unix_timestamp double precision);

CREATE OR REPLACE FUNCTION gis.get_handovers(IN integer)
  RETURNS TABLE(source_id integer, handover_id integer, target_id integer, target_name character varying, source_name character varying, tag_name character varying, direction text, existence text[], handover_tags character varying[]) AS


GRANT ALL ON TABLE gis.handover_relation TO minerva_admin;
GRANT SELECT ON TABLE gis.handover_relation TO minerva;


CREATE TYPE gis.existence_change AS (exists boolean, unix_timestamp double precision);

CREATE OR REPLACE VIEW gis.handover_relation_existence AS
SELECT
