[object Object]

← back to Nationalrealestate

parcels: fix nyc_pluto 08P01 — provenance added 4 cols (19→23), drop chunk 3000→2500 to stay under PG 65535 bind-param cap

f6fb527e1bd04ee7ea61b7d556da05f165c52b6a · 2026-07-28 11:56:31 -0700 · Steve Abrams

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit f6fb527e1bd04ee7ea61b7d556da05f165c52b6a
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Tue Jul 28 11:56:31 2026 -0700

    parcels: fix nyc_pluto 08P01 — provenance added 4 cols (19→23), drop chunk 3000→2500 to stay under PG 65535 bind-param cap
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
 src/ingest/parcels/nyc_pluto.ts | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/ingest/parcels/nyc_pluto.ts b/src/ingest/parcels/nyc_pluto.ts
index 261d4cf..2c72c7c 100644
--- a/src/ingest/parcels/nyc_pluto.ts
+++ b/src/ingest/parcels/nyc_pluto.ts
@@ -43,9 +43,10 @@ const num = (v: unknown) => { const n = Number(v); return Number.isFinite(n) ? n
 
 async function upsertBatch(all: any[]): Promise<number> {
   if (!all.length) return 0;
-  // Postgres caps a statement at 65535 bind params; 19 cols -> keep chunks <= ~3000 rows.
+  // Postgres caps a statement at 65535 bind params; 23 cols (19 + 4 TK-50 provenance) ->
+  // keep chunks <= 2500 rows (23*2500=57,500 < 65,535). Was 3000 pre-provenance (23*3000=69k overflowed → 08P01).
   let done = 0;
-  for (let i = 0; i < all.length; i += 3000) done += await upsertChunk(all.slice(i, i + 3000));
+  for (let i = 0; i < all.length; i += 2500) done += await upsertChunk(all.slice(i, i + 2500));
   return done;
 }
 

← 23c88a6 feat: RENTV data feed over usre DB (:9796) — brokers/firms/c  ·  back to Nationalrealestate  ·  chore: version bump v0.16.1 (session close — nyc_pluto 08P01 c783195 →