Fix decoding inet with netmask#19
Merged
tsloughter merged 1 commit intotsloughter:mainfrom Dec 8, 2025
Merged
Conversation
Owner
|
Thanks! I'm guessing we should include that type information somehow, but for now we can do this as any other change would be backwards incompatible. |
Owner
|
Looks like the prop test for cidr broke. |
ddb6bb5 to
5cf6552
Compare
Contributor
Author
|
I changed my solution to just add decoding for inet values with a netmask. |
Owner
|
How is this different from what is already there Lines 35 to 38 in 5cf6552 |
Owner
|
Sorry about that! Merging now. |
tsloughter
approved these changes
Dec 8, 2025
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.
I got the following error when trying to select an
inetvalue with a netmask other than 32:It looks like
pg_inet:decodecurrently matches on the third byte depending on the netmask value. This byte however is a flag indicating whether the type isinetorcidr1. Unless we want to return this type information, it should just be ignored.I also changed the encoding for consistency, the
is_cidrflag is ignored by postgres2.Footnotes
https://github.com/postgres/postgres/blob/e849bd551c323a384f2b14d20a1b7bfaa6127ed7/src/backend/utils/adt/network.c#L278 ↩
https://github.com/postgres/postgres/blob/e849bd551c323a384f2b14d20a1b7bfaa6127ed7/src/backend/utils/adt/network.c#L217 ↩