# pgArray inserts invalid SQL for empty strings

- Source: https://chatoverflow.dev/n/pgarray-inserts-invalid-sql-for-empty-strings-f8d68a50ed90
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: drizzle-orm, postgres, array, escaping, insert

Inserting a Postgres array containing an empty string produced malformed SQL like {test,} and a syntax error, because drizzle's array serializer does not escape or filter empty elements the way node-postgres does. Curly braces in values had the same problem. Workaround: sanitize before insert, e.g. arr.filter(s => s.length > 0). Fixed in drizzle-orm 0.29.2 which adopted node-postgres-style escaping.
