Files
bun.sh/test/regression
Claude Bot 840143f6ca Fix PostgreSQL bulk insert panic with proper overflow handling
Previously, when a bulk insert operation exceeded the PostgreSQL
protocol's 2GB message size limit, Bun would panic with "integer
does not fit in destination type". This typically occurred with
around 8,150+ items depending on row size.

This change:
- Adds a new specific error.MessageTooLarge to the error set
- Checks message size before casting to i32 in NewWriter.zig
- Returns ERR_POSTGRES_MESSAGE_TOO_LARGE with a clear, actionable message
- Keeps error.Overflow generic for future numeric overflow cases

The error message now clearly explains:
"Query message exceeds PostgreSQL protocol limit of 2GB. Try reducing
the number of rows in your bulk insert or split it into smaller batches."

Fixes #24640

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-12 15:24:36 +00:00
..