Skip to content

Add support for PostgreSQL oid8 and oid8[] - #2696

Merged
jackc merged 2 commits into
jackc:masterfrom
k-zshiba:support-oid8
Oct 26, 2026
Merged

jackc merged 2 commits into
jackc:masterfrom
k-zshiba:support-oid8

Conversation

@k-zshiba

Copy link
Copy Markdown
Contributor

Closes #2695.

PostgreSQL 19 introduces oid8, an unsigned eight-byte object identifier type. Add its OID constants and default type registrations so pgx recognizes oid8 and oid8[] without manual registration.

Register oid8 (OID 6437) with the existing Uint64Codec, and _oid8 (OID 6442) with ArrayCodec.

Add round-trip tests covering zero, the maximum uint64 value, nullable values, and string conversion. The array test covers maximum values, NULL elements, and zero using describe/execute and simple protocol query modes. The new database tests skip PostgreSQL versions below 19 and CockroachDB.

Validation:

go test -race ./pgtype -run '^(TestOID8.*|TestUint64Codec.*|TestUint32Codec|TestArrayCodec|TestArrayCodecFlatArrayString|TestUintArray.*)$' -v -count=1

Passed with Go 1.25.5 against a temporary PostgreSQL 19rc1 instance. All selected tests ran without skips. Also verified CopyFrom, Rows.Values(), and database/sql handling of the maximum uint64 value and NULL with the race detector enabled.

Since PostgreSQL 19 has not reached its final release yet, I'd appreciate your guidance on the appropriate timing for merging this change.

Register the PostgreSQL 19 oid8 type with Uint64Codec and its array type
with ArrayCodec. Add OID constants for both types.

Add round-trip coverage for zero, maximum uint64, nullable values, and
string conversion. Cover array values with a NULL element using both
describe/execute and simple protocol query modes.
@jackc
jackc merged commit db95468 into jackc:master Oct 26, 2026
22 checks passed
@jackc

jackc commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Seems fair to merge now. Can't see this getting reverted before final PG 19 release.

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.

Add built-in support for PostgreSQL oid8 and oid8[]

2 participants