From 02734607cc766317b731be467088f672250df8dd Mon Sep 17 00:00:00 2001 From: Stan Runge Date: Sun, 25 Oct 2026 21:12:12 +0000 Subject: [PATCH] stats: cast jsonb chunk param via text so jsonb_populate_recordset gets an array (step 2 loads) --- scripts/stats/common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/stats/common.ts b/scripts/stats/common.ts index c8368c6..1b3d332 100644 --- a/scripts/stats/common.ts +++ b/scripts/stats/common.ts @@ -264,7 +264,7 @@ export async function insertChunks( .join(', '); for (let i = 0; i < rows.length; i += size) { await tx.unsafe( - `insert into stats.${table} (${cols}) select ${cols} from jsonb_populate_recordset(null::stats.${table}, $1::jsonb) ${conflict}`, + `insert into stats.${table} (${cols}) select ${cols} from jsonb_populate_recordset(null::stats.${table}, ($1::text)::jsonb) ${conflict}`, [JSON.stringify(rows.slice(i, i + size))] as never ); }