Taken from here.
Query iterates over rows of table my_table. The last printed ctid - is the last before corrupted row. After getting this value ('(78498,1)' for example) you should check the next one ('(78498,2)' for example):
SELECT * FROM my_table WHERE ctid = '(78498,2)';And then delete it.