Code Postal New Folder 582.rar -
-- Update changed rows UPDATE postal_codes p SET city = s.city, lat = s.lat, lng = s.lng FROM postal_codes_stg s WHERE p.code = s.code AND (p.city <> s.city OR p.lat <> s.lat OR p.lng <> s.lng);
# Extract unrar x 582.rar # preserves full paths # or unrar e 582.rar # extracts all files into the current directory A folder (often named 582 or the name encoded inside the archive) containing the files listed above. 4.3 Quick Data Exploration Assuming the primary file is postal_codes.csv : Code postal new folder 582.rar
# List contents (optional) unrar l 582.rar -- Update changed rows UPDATE postal_codes p SET city = s
-- Delete obsolete codes DELETE FROM postal_codes p USING postal_codes_stg s WHERE p.code = s.code AND s.is_active = FALSE; -- assuming a flag in the new file lat = s.lat