Postgres custom type edge cases #428
Merged
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.
During the initial replication (via
WalStream.snapshotTable), this now takes the type registry into account when decoding values. This fixes parsingbox[]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.tsmore 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_valuetest). Legacy format gives a number1for the snapshot query, but a string"1"for streaming replication. The reason is that postgres seems to return the inner type as atypeOidwhen selecting domain values?