scp 2023-03-09_obs_to_delete.csv geonat@db-paca-sinp:/home/geonat/data/cbnmed/data/raw/
gn_imports
:CREATE TABLE gn_imports.cbnmed_20230309_fix_obs_to_delete ( unique_id_sinp uuid NOT NULL, CONSTRAINT cbnmed_20230309_fix_obs_to_delete_pk PRIMARY KEY (unique_id_sinp) );
cd data/cbnmed/data/raw/
cat ./2023-03-09_obs_to_delete.csv | psql -h localhost -U geonatadmin geonature2db -c "COPY gn_imports.cbnmed_20230309_fix_obs_to_delete(unique_id_sinp) FROM STDIN DELIMITER ',' CSV HEADER;"
psql -h localhost -U geonatadmin geonature2db -c "DELETE FROM gn_synthese.synthese WHERE id_source = 193 AND unique_id_sinp IN (SELECT unique_id_sinp FROM gn_imports.cbnmed_20230309_fix_obs_to_delete);"
SELECT * FROM gn_synthese.synthese WHERE id_source = 193 AND unique_id_sinp IN (SELECT unique_id_sinp FROM gn_imports.cbnmed_20230309_fix_obs_to_delete);