Fix encoding/decoding of arrays of domains defined over arrays#778
Merged
greg-rychlewski merged 1 commit intoJul 6, 2026
Merged
Conversation
greg-rychlewski
commented
Jul 5, 2026
Comment on lines
+120
to
+121
| def recurse_nested_arrays({__MODULE__, _, _}), do: false | ||
| def recurse_nested_arrays(_), do: true |
Member
Author
There was a problem hiding this comment.
The reason why this check works is because no matter how many dimensions the array is over a non-domain type, the sub type is still considered the base type. For example [[[[[int]]]]] will still just have a sub type of int. This is enforced by Postgres and not just a quirk of how we handle types.
But [domain_over_array] will have a sub type of array. This is also enforced by postgres or else the protocol rejects it. i.e. postgres doesn't see base_type[][] the same as domain_over_array_of_base_type[].
josevalim
approved these changes
Jul 6, 2026
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.
Sorry for throwing another weird one your way about domains. This comment here basically explains it