Skip to content

Conversation

@rkistner
Copy link
Contributor

@rkistner rkistner commented Dec 8, 2025

During the initial replication (via WalStream.snapshotTable), this now takes the type registry into account when decoding values. This fixes parsing box[] values, which were already parsed correctly for streaming replication (using the type registry) but not the initial one. Closes #405.

This also makes decoding tests in pg_test.test.ts more realistic by fetching types for regular queries.

Additionally, this fixes decoding arrays of enums, e.g. moods[]. These used to be replicated as {sad,happy} for both the snapshot and streaming queries, which has been fixed to ["sad","happy"] in this PR.

Finally, one thing that is still failing is decoding custom domain values (see the rating_value test). Legacy format gives a number 1 for the snapshot query, but a string "1" for streaming replication. The reason is that postgres seems to return the inner type as a typeOid when selecting domain values?

@changeset-bot
Copy link

changeset-bot bot commented Dec 8, 2025

🦋 Changeset detected

Latest commit: a402a02

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@powersync/service-module-postgres Patch
@powersync/service-schema Patch
@powersync/service-image Patch
@powersync/service-core Patch
@powersync/service-core-tests Patch
@powersync/service-module-core Patch
@powersync/service-module-mongodb-storage Patch
@powersync/service-module-mongodb Patch
@powersync/service-module-mssql Patch
@powersync/service-module-mysql Patch
@powersync/service-module-postgres-storage Patch
test-client Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@simolus3 simolus3 force-pushed the fix-postgres-custom-types branch from 0297c9e to 8beab92 Compare December 12, 2025 09:09
Copy link
Contributor Author

@rkistner rkistner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes look good to me

@simolus3 simolus3 marked this pull request as ready for review December 12, 2025 09:35
@simolus3 simolus3 merged commit a4ead94 into main Dec 12, 2025
24 checks passed
@simolus3 simolus3 deleted the fix-postgres-custom-types branch December 12, 2025 11:05
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.

[Postgres] box[] values are not parsed correctly on initial replication

4 participants