 $$ 
 LANGUAGE sql STRICT;
 
-CREATE AGGREGATE citydb_pkg1.delete_external_references(int)
+CREATE AGGREGATE citydb_pkg.delete_external_references(int)
 (
     sfunc = array_append,
     stype = int[],
-    finalfunc = citydb_pkg1.delete_external_references
+    finalfunc = citydb_pkg.delete_external_references
 );
 
 /*****************************************************************

* @return
* array of IDs from deleted transportation complexes
******************************************************************/
CREATE OR REPLACE FUNCTION citydb_pkg1.delete_transport_complexes(int[]) RETURNS int[] AS
$$
DECLARE
  result_array int[] := '{}';
  parts_array int[] := '{}';
BEGIN
  -- delete traffic areas
  PERFORM citydb_pkg1.delete_traffic_areas(ta.id)
    FROM traffic_area ta, (
      SELECT unnest($1) AS tc_id
    ) a   

  END IF;

  -- delete geometries and cityobjects
  PERFORM citydb_pkg.delete_cityobject_geometries(result_array);
  PERFORM citydb_pkg.intern_delete_cityobjects(result_array);

  RETURN result_array;
END;
$$
LANGUAGE plpgsql STRICT;

CREATE AGGREGATE citydb_pkg.delete_bridge_constr_elements(int)
(
    sfunc = array_append,
    stype = int[],
    finalfunc = citydb_pkg.delete_bridge_constr_elements
);

/*****************************************************************
