SELECT util.search_path_append('util'); SELECT create_if_not_exists($$CREATE INDEX "Specimen.acronym" ON $$||:table_str||$$ ("dwc_terms_institutionCode")$$); -- Remove institutions that we have direct data for DELETE FROM :table WHERE "dwc_terms_institutionCode" IN ( 'MO' , 'NY' ) /* list obtained using: SELECT DISTINCT dataprovider FROM sourcelist JOIN provider_count ON provider_count.dataprovider = sourcelist.name WHERE source_id = source_by_shortname('SpeciesLink') ORDER BY dataprovider */ ;