Conversation
arybczak
force-pushed
the
no-libpqtypes
branch
7 times, most recently
from
July 12, 2026 01:05
ed40028 to
b5aaed1
Compare
arybczak
force-pushed
the
no-libpqtypes
branch
3 times, most recently
from
July 12, 2026 03:41
738b5bd to
0f44dcf
Compare
This was referenced Jul 12, 2026
arybczak
force-pushed
the
no-libpqtypes
branch
9 times, most recently
from
July 20, 2026 06:56
d2fb50f to
aa47fec
Compare
The library shipped a vendored copy of the libpqtypes C library and built its encoding and decoding of values on the format strings of that library. The copy was old, hard to maintain and hid the wire format from the Haskell side. The library now talks to plain libpq and handles the binary wire format itself, with encoders and decoders derived from the postgresql-binary package and fixed where that package was wrong. Values decode through a row decoder that consumes the fields of a result, which replaces the FromRow machinery, the composite registration and the format strings. Arrays, ranges, network types, enums and JSON get first class support, and the date and time types reject the values that the Haskell types cannot represent. Queries run synchronously in a helper thread, so that an asynchronous exception cancels them server side. This is a major release. CHANGELOG.md lists the changes in the public behavior, and migration-2.0.md walks through the update of downstream code.
arybczak
force-pushed
the
no-libpqtypes
branch
from
September 21, 2026 18:23
523c620 to
f56f4a7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Drop the bundled libpqtypes C library. Queries are now executed with the API of plain libpq and the binary transport format is handled by the code based on postgresql-binary package (with some bugs fixed).
The library now supports decoding of arbitrary composite (row) types (in particular anonymous ones), named composite types are no longer necessary (and thus no longer have to be registered up-front).
Support for enum types is also improved, single values don't need casts anymore when passed as parameters (arrays of enums still do unfortunately).
Benchmark results against master:
Selection of big arrays of primitive types (4th benchmark, 100000 elements of int4) is now slightly slower, but this is an edge case that we don't really make use of. I actually managed to make this faster than baseline, but the additional code complexity wasn't IMO worth it.