mirror of
https://github.com/docmost/docmost.git
synced 2026-05-08 23:33:09 +08:00
5ebab5cd9e
The plpgsql + EXCEPTION versions of base_cell_numeric, base_cell_timestamptz, and base_cell_bool were labeled PARALLEL SAFE but EXCEPTION blocks require subtransactions, which Postgres cannot start in a parallel worker. Any parallel scan that invoked them crashed with 'cannot start subtransactions during a parallel operation' — notably DuckDB's postgres extension on large base COPY reads. Rewrite each as a pure SQL function using jsonb_typeof + regex validation for the 'coerce-or-null' semantics. No plpgsql, no subtransactions, genuinely parallel-safe. Signatures unchanged so existing call sites (loader, expression indexes, engine predicates) are untouched.