Skip to content

Type int4range/int8range values before insert/COPY#910

Open
kvch wants to merge 1 commit into
mainfrom
fix/type-integer-range-values
Open

Type int4range/int8range values before insert/COPY#910
kvch wants to merge 1 commit into
mainfrom
fix/type-integer-range-values

Conversation

@kvch

@kvch kvch commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Problem

When an int4range/int8range value arrives as pgtype.Range[any], pgx cannot encode it to the binary wire format for the target column (the bounds are untyped any), so inserts and bulk COPY fail.

Fix

Normalize int4range and int8range values from pgtype.Range[any] into typed pgtype.Range[int32] / pgtype.Range[int64] before insert/COPY handling (tstzrange already had handling).


Cherry-picked from @danddanddand (fix/type-integer-range-values).

@github-actions

Copy link
Copy Markdown

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/xataio/pgstream/pkg/wal/processor/postgres 79.81% (+0.59%) 👍

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/xataio/pgstream/pkg/wal/processor/postgres/postgres_wal_dml_adapter.go 94.06% (+0.38%) 202 (+28) 190 (+27) 12 (+1) 👍

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/xataio/pgstream/pkg/wal/processor/postgres/postgres_wal_dml_adapter_bulk_test.go

@kvch kvch requested a review from tsg June 23, 2026 18:11
@kvch kvch marked this pull request as ready for review June 23, 2026 18:11
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