 BEGIN
 
 
-DROP TABLE IF EXISTS _campaign_indicator;
+		DROP TABLE IF EXISTS _campaign_indicator;
 		CREATE TABLE _campaign_indicator AS
 		SELECT DISTINCT campaign_id, indicator_id FROM datapoint d
 		WHERE d.cache_job_id = $1;

		AND ta.campaign_id = d.campaign_id
		AND ta.indicator_id = d.indicator_id;


		--- UPDATE THE REST OF THE DATAPOINT TABLE --

		UPDATE datapoint d
		SET cache_job_id = $1
		WHERE d.id in (

			FROM _to_agg ta
			WHERE ta.datapoint_id IS NOT NULL
		);

		--------------------
		--- BEGIN UPSERT ---
		--------------------


		-- UPDATE EXISTING --
		UPDATE agg_datapoint ad
