 
 RETURN QUERY
 
-SELECT id
+SELECT sr.id
 FROM source_region sr
 LIMIT 1;
 

-- DELETE ACTUAL DUPES.. IE NOT REGIONS WITH SAME NAME WITH DIFF PARENT--
DELETE
FROM _odk_settlements
WHERE settlementname in
(
	SELECT
		settlementname
		--,count(*) AS C
	FROM _odk_settlements
	GROUP BY settlementname having count(*) > 1
);

DELETE
FROM _odk_settlements
WHERE REPLACE(settlementname,' ' ,'-') in
(
	SELECT
		REPLACE(settlementname,' ' ,'-')
		--,count(*) AS C
	FROM _odk_settlements
	GROUP BY REPLACE(settlementname,' ' ,'-') having count(*) > 1
);



 	,CAST(ovs.settlementgps_longitude AS FLOAT)
 	,2 as region_type_id --settlement
 	,1 as office_id -- nigeria
 	,REPLACE(settlementname,' ' ,'-') AS region_slug
 	,now()
 	,s.id
 	,CAST(0 as BOOLEAN)
