mirror of
https://github.com/oven-sh/bun
synced 2026-02-14 04:49:06 +00:00
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>