Hacker News new | ask | show | jobs
by wefarrell 1000 days ago
Maybe I'm missing something but I don't see how it's possible for a COPY statement alone to remove existing data.
1 comments

If in the regular scenario you load 10000 rows of new data and delete the old then it’s fine.

What if someone screws up the zip and instead of 10000 today, it’s only 10?

I had this last week, but instead it was a 3rd party api and their service started returning null instead of true for the has_more property beyond the second page of results.

In either the solution is probably to check rough counts and error if not reasonable.

I think generally don't replace the prod db until the new one passes tests.