
Tech
How JSON.stringify Corrupted 150,000 Rows in My Postgres Database
I stored arrays in Postgres jsonb columns using postgres.js + JSON.stringify. The driver serialized them a second time, so ~150,000 values across ten columns were silently saved as jsonb strings, not arrays. They looked right and matched no filters. Root cause, detection (jsonb_typeof = 'string'), repair, and the safe pattern (sql.json).
Read the full discussion on HackerNoon
This article was aggregated from HackerNoon. Click to join the conversation.
View on HackerNoon