Skip to content

pgtype: preserve delimiters inside multirange bounds - #2651

Merged
jackc merged 1 commit into
jackc:masterfrom
sueun-dev:fix-multirange-text-bounds-20260909
Sep 12, 2026
Merged

jackc merged 1 commit into
jackc:masterfrom
sueun-dev:fix-multirange-text-bounds-20260909

Conversation

@sueun-dev

Copy link
Copy Markdown
Contributor

Text decoding of a custom text multirange fails when a bound contains a comma or }. parseRange treats these characters as multirange separators even when they belong to a range bound.

Track range boundaries, quotes and escapes while splitting the elements. The regression uses PostgreSQL to construct two ranges with special characters in both endpoints and checks text and binary decoding. Parser tests also cover escaped delimiters and malformed input.

Tested with Go 1.25.13 and PostgreSQL 18.6 on Linux arm64:

go test -race ./pgtype -run 'TestMultirangeCodecTextBounds|TestParseUntypedTextMultirangeBounds' -count=20
go test -race ./... -count=1
go build ./...

Both regression tests fail on the base commit and pass with this change. Optional authentication, TLS and PgBouncer tests were not configured; the other Go, PostgreSQL and OS matrix combinations were not run locally.

This is an AI proposal produced with Codex. The task was to resume a held multirange parsing defect, reproduce it against PostgreSQL, and prepare a minimal fix with regression and broader tests. It has not had human code review.

@jackc
jackc merged commit 414ce72 into jackc:master Sep 12, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants