Damus
Rob Thomas [Admin m.au] profile picture
Rob Thomas [Admin m.au]
@Rob Thomas [Admin m.au]


Any #PostgreSQL exports around to help me out here? After a storage server crash, I've ended up with (at least one) table having corrupt time data in it. There is, apparently, no way to pg_dump and ignore errors, and \COPY also doesn't appear to continue-on-error.

What I want to do is just get a list of the IDs of the rows with the corrupt time entries so I can either fix them, or just delete them.

This is the 'status_stats' table from #MastodonNZ, and has about 70m rows.

My current plan is that I've copied the schema of status_stats to status_stats_new, changing the time rows to just 'text' and I'm doing 'insert into status_stats_new select * from status_stats ON CONFLICT DO NOTHING;' then a left join to find missing ones.

IS THERE A BETTER WAY? Halp!

1
regenera · 4w
You seem to be on the right track, have you managed to isolate the corrupted rows? I imagine they would be the most recent rows too. Presumably, status_stats_new is also dumpable (you probably only want to export the id and any time fields for further inspection).