Skip to content

Add bytea type conversion#119

Merged
SeanTAllen merged 1 commit intomainfrom
bytea-type-conversion
Feb 13, 2026
Merged

Add bytea type conversion#119
SeanTAllen merged 1 commit intomainfrom
bytea-type-conversion

Conversation

@SeanTAllen
Copy link
Copy Markdown
Member

PostgreSQL bytea columns (OID 17) are now decoded from hex format into Array[U8] val instead of being returned as raw hex strings. Only hex format is supported (the default since PostgreSQL 9.0).

The FieldDataTypes union gains Array[U8] val as a ninth variant. Existing code is unaffected — Pony's match is non-exhaustive, so code without a bytea arm continues to work.

Field.eq() implements element-by-element comparison for byte arrays since Pony's Array uses identity comparison by default.

Design: #118

PostgreSQL bytea columns (OID 17) are now decoded from hex format
into Array[U8] val instead of being returned as raw hex strings.
The decode validates the \x prefix and hex digit pairs at the
_RowsBuilder boundary, producing an immutable byte array that
consumers can use directly.

Array[U8] val uses identity comparison by default in Pony, so
Field.eq() implements element-by-element comparison for the new
variant.

Design: #118
@SeanTAllen SeanTAllen added the changelog - added Automatically add "Added" CHANGELOG entry on merge label Feb 13, 2026
@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Feb 13, 2026
@SeanTAllen SeanTAllen merged commit bed5988 into main Feb 13, 2026
11 checks passed
@SeanTAllen SeanTAllen deleted the bytea-type-conversion branch February 13, 2026 14:41
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Feb 13, 2026
github-actions bot pushed a commit that referenced this pull request Feb 13, 2026
github-actions bot pushed a commit that referenced this pull request Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog - added Automatically add "Added" CHANGELOG entry on merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants