Repository navigation
Conversation
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.
Summary
This adds the range types
int4range,int8range,numrange,tsrange,tstzrangeanddaterange. A range value keeps its flags and its two bounds as values of the subtype, asrangetypes.cdoes.Changes
rupg-typeshas the newRangevalue withrange_parse,range_deparse,range_recvandrange_send. The parse gives the details of PostgreSQL for a malformed literal.pg_input_is_validandpg_input_error_infowork.make_rangechecks the order of the bounds, makes a range empty when the bounds are equal and one bound is exclusive, and applies the canonical form ofint4range,int8rangeanddaterange. The overflow errors of the canonical form are the errors of PostgreSQL.range_constructor2,range_constructor3,lower,upper,isempty,lower_inc,upper_inc,lower_inf,upper_infandrange_cmp. The comparison operators,ORDER BY,DISTINCT,GROUP BY,GREATESTandLEASTuse the order ofrange_cmp.anyrange,anymultirange,anycompatiblerangeandanycompatiblemultirangewith the rules and the errors ofenforce_generic_type_consistency.GREATESTandLEASTfind the<of a type through its default btree operator class when the type has no<of its own.Tests
rangeis the output of PostgreSQL 19 for the same script in a new database. It has the text forms, the errors, the constructors, the functions of the bounds, the order, arrays of ranges, a parameter and the text and binary forms ofCOPY.