Failed upgrade: UniqueViolation: duplicate key value violates unique constraint "data_explorer_queries_pkey"

Yep, also, in general consider running commands to see their impact before committing, see:

Then if you find you have deleted 500 rows when you meant to hit just one, you have the chance to rollback without fear.