8000 docs: clarify infinite range values from data-type infinities · postgres/postgres@650692a · GitHub
[go: up one dir, main page]

Skip to content
{"payload":{"commit":{"oid":"650692a18d29c44c8019545c02ba42c3efd2c964","url":"/postgres/postgres/commit/650692a18d29c44c8019545c02ba42c3efd2c964","authoredDate":"2019-12-27T14:33:30.000-05:00","committedDate":"2019-12-27T14:33:30.000-05:00","shortMessage":null,"shortMessageMarkdown":"\u003cdiv\u003edocs: clarify infinite range values from data-type infinities\u003c/div\u003e","shortMessageMarkdownLink":null,"bodyMessageHtml":"The previous docs referenced these distinct ideas confusingly.\n\nReported-by: Eugen Konkov\n\nDiscussion: \u003ca href=\"https://postgr.es/m/376945611.20191026161529@yandex.ru\" rel=\"nofollow\"\u003ehttps://postgr.es/m/376945611.20191026161529@yandex.ru\u003c/a\u003e\n\nBackpatch-through: 9.4","authors":[{"login":"bmomjian","displayName":"Bruce Momjian","avatarUrl":"https://avatars.githubusercontent.com/u/412153?v=4","path":"/bmomjian","isGitHub":false}],"committerAttribution":false,"committer":{"login":"bmomjian","displayName":"Bruce Momjian","avatarUrl":"https://avatars.githubusercontent.com/u/412153?v=4","path":"/bmomjian","isGitHub":false},"parents":["a052f6cbb84e5630d50b68586cecc127e64be639"],"globalRelayId":"MDY6Q29tbWl0OTI3NDQyOjY1MDY5MmExOGQyOWM0NGM4MDE5NTQ1YzAyYmE0MmMzZWZkMmM5NjQ=","sha1":"a052f6cbb84e5630d50b68586cecc127e64be639","sha2":"650692a18d29c44c8019545c02ba42c3efd2c964"},"currentUser":null,"repo":{"id":927442,"defaultBranch":"master","name":"postgres","ownerLogin":"postgres","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2010-09-21T11:35:45.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/177543?v=4","public":true,"private":false,"isOrgOwned":true},"diffEntryData":[{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":130,"text":"@@ -131,29 +131,26 @@ SELECT isempty(numrange(1, 5));","html":"@@ -131,29 +131,26 @@ SELECT isempty(numrange(1, 5));","displayNoNewLineWarning":false,"position":0,"left":130,"right":130},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":131,"text":" \u003ctitle\u003eInfinite (Unbounded) Ranges\u003c/title\u003e","html":" \u0026lt;title\u0026gt;Infinite (Unbounded) Ranges\u0026lt;/title\u0026gt;","displayNoNewLineWarning":false,"position":1,"left":131,"right":131},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":132,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":2,"left":132,"right":132},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":133,"text":" \u003cpara\u003e","html":" \u0026lt;para\u0026gt;","displayNoNewLineWarning":false,"position":3,"left":133,"right":133},{"stylingDirective":null,"type":"DELETION","blobLineNumber":134,"text":"- The lower bound of a range can be omitted, meaning that all points less","html":"- The lower bound of a range can be omitted, meaning that all points less","displayNoNewLineWarning":false,"position":4,"left":134,"right":133},{"stylingDirective":null,"type":"DELETION","blobLineNumber":135,"text":"- than the upper bound are included in the range. Likewise, if the upper","html":"- than the upper bound are included in the range. Likewise, if the upper","displayNoNewLineWarning":false,"position":5,"left":135,"right":133},{"stylingDirective":null,"type":"DELETION","blobLineNumber":136,"text":"- bound of the range is omitted, then all points greater than the lower bound","html":"- bound of the range is omitted, then all points greater than the lower bound","displayNoNewLineWarning":false,"position":6,"left":136,"right":133},{"stylingDirective":null,"type":"DELETION","blobLineNumber":137,"text":"- are included in the range. If both lower and upper bounds are omitted, all","html":"- are included in the range. If both lower and upper bounds are omitted, all","displayNoNewLineWarning":false,"position":7,"left":137,"right":133},{"stylingDirective":null,"type":"DELETION","blobLineNumber":138,"text":"- values of the element type are considered to be in the range.","html":"- values of the element type are considered to be in the range.","displayNoNewLineWarning":false,"position":8,"left":138,"right":133},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":134,"text":"+ The lower bound of a range can be omitted, meaning that all","html":"+ The lower bound of a range can be omitted, meaning that all","displayNoNewLineWarning":false,"position":9,"left":138,"right":134},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":135,"text":"+ values less than the upper bound are included in the range, e.g.,","html":"+ values less than the upper bound are included in the range, e.g.,","displayNoNewLineWarning":false,"position":10,"left":138,"right":135},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":136,"text":"+ \u003cliteral\u003e(,3]\u003c/literal\u003e. Likewise, if the upper bound of the range","html":"+ \u0026lt;literal\u0026gt;(,3]\u0026lt;/literal\u0026gt;. Likewise, if the upper bound of the range","displayNoNewLineWarning":false,"position":11,"left":138,"right":136},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":137,"text":"+ is omitted, then all values greater than the lower bound are included","html":"+ is omitted, then all values greater than the lower bound are included","displayNoNewLineWarning":false,"position":12,"left":138,"right":137},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":138,"text":"+ in the range. If both lower and upper bounds are omitted, all values","html":"+ in the range. If both lower and upper bounds are omitted, all values","displayNoNewLineWarning":false,"position":13,"left":138,"right":138},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":139,"text":"+ of the element type are considered to be in the range. Specifying a","html":"+ of the element type are considered to be in the range. Specifying a","displayNoNewLineWarning":false,"position":14,"left":138,"right":139},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":140,"text":"+ missing bound as inclusive is automatically converted to exclusive,","html":"+ missing bound as inclusive is automatically converted to exclusive,","displayNoNewLineWarning":false,"position":15,"left":138,"right":140},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":141,"text":"+ e.g., \u003cliteral\u003e[,]\u003c/literal\u003e is converted to \u003cliteral\u003e(,)\u003c/literal\u003e.","html":"+ e.g., \u0026lt;literal\u0026gt;[,]\u0026lt;/literal\u0026gt; is converted to \u0026lt;literal\u0026gt;(,)\u0026lt;/literal\u0026gt;.","displayNoNewLineWarning":false,"position":16,"left":138,"right":141},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":142,"text":"+ You can think of these missing values as +/-infinity, but they are","html":"+ You can think of these missing values as +/-infinity, but they are","displayNoNewLineWarning":false,"position":17,"left":138,"right":142},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":143,"text":"+ special range type values and are considered to be beyond any range","html":"+ special range type values and are considered to be beyond any range","displayNoNewLineWarning":false,"position":18,"left":138,"right":143},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":144,"text":"+ element type's +/-infinity values.","html":"+ element type\u0026#39;s +/-infinity values.","displayNoNewLineWarning":false,"position":19,"left":138,"right":144},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":145,"text":" \u003c/para\u003e","html":" \u0026lt;/para\u0026gt;","displayNoNewLineWarning":false,"position":20,"left":139,"right":145},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":146,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":21,"left":140,"right":146},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":147,"text":" \u003cpara\u003e","html":" \u0026lt;para\u0026gt;","displayNoNewLineWarning":false,"position":22,"left":141,"right":147},{"stylingDirective":null,"type":"DELETION","blobLineNumber":142,"text":"- This is equivalent to considering that the lower bound is \u003cquote\u003eminus","html":"- This is equivalent to considering that the lower bound is \u0026lt;quote\u0026gt;minus","displayNoNewLineWarning":false,"position":23,"left":142,"right":147},{"stylingDirective":null,"type":"DELETION","blobLineNumber":143,"text":"- infinity\u003c/quote\u003e, or the upper bound is \u003cquote\u003eplus infinity\u003c/quote\u003e,","html":"- infinity\u0026lt;/quote\u0026gt;, or the upper bound is \u0026lt;quote\u0026gt;plus infinity\u0026lt;/quote\u0026gt;,","displayNoNewLineWarning":false,"position":24,"left":143,"right":147},{"stylingDirective":null,"type":"DELETION","blobLineNumber":144,"text":"- respectively. But note that these infinite values are never values of","html":"- respectively. But note that these infinite values are never values of","displayNoNewLineWarning":false,"position":25,"left":144,"right":147},{"stylingDirective":null,"type":"DELETION","blobLineNumber":145,"text":"- the range's element type, and can never be part of the range. (So there","html":"- the range\u0026#39;s element type, and can never be part of the range. (So there","displayNoNewLineWarning":false,"position":26,"left":145,"right":147},{"stylingDirective":null,"type":"DELETION","blobLineNumber":146,"text":"- is no such thing as an inclusive infinite bound \u0026mdash; if you try to","html":"- is no such thing as an inclusive infinite bound \u0026amp;mdash; if you try to","displayNoNewLineWarning":false,"position":27,"left":146,"right":147},{"stylingDirective":null,"type":"DELETION","blobLineNumber":147,"text":"- write one, it will automatically be converted to an exclusive bound.)","html":"- write one, it will automatically be converted to an exclusive bound.)","displayNoNewLineWarning":false,"position":28,"left":147,"right":147},{"stylingDirective":null,"type":"DELETION","blobLineNumber":148,"text":"- \u003c/para\u003e","html":"- \u0026lt;/para\u0026gt;","displayNoNewLineWarning":false,"position":29,"left":148,"right":147},{"stylingDirective":null,"type":"DELETION","blobLineNumber":149,"text":"-","html":"-","displayNoNewLineWarning":false,"position":30,"left":149,"right":147},{"stylingDirective":null,"type":"DELETION","blobLineNumber":150,"text":"- \u003cpara\u003e","html":"- \u0026lt;para\u0026gt;","displayNoNewLineWarning":false,"position":31,"left":150,"right":147},{"stylingDirective":null,"type":"DELETION","blobLineNumber":151,"text":"- Also, some element types have a notion of \u003cquote\u003einfinity\u003c/quote\u003e, but that","html":"- Also, some element types have a notion of \u0026lt;quote\u0026gt;infinity\u0026lt;/quote\u0026gt;, but that","displayNoNewLineWarning":false,"position":32,"left":151,"right":147},{"stylingDirective":null,"type":"DELETION","blobLineNumber":152,"text":"- is just another value so far as the range type mechanisms are concerned.","html":"- is just another value so far as the range type mechanisms are concerned.","displayNoNewLineWarning":false,"position":33,"left":152,"right":147},{"stylingDirective":null,"type":"DELETION","blobLineNumber":153,"text":"- For example, in timestamp ranges, \u003cliteral\u003e[today,]\u003c/literal\u003e means the same","html":"- For example, in timestamp ranges, \u0026lt;literal\u0026gt;[today,]\u0026lt;/literal\u0026gt; means the same","displayNoNewLineWarning":false,"position":34,"left":153,"right":147},{"stylingDirective":null,"type":"DELETION","blobLineNumber":154,"text":"- thing as \u003cliteral\u003e[today,)\u003c/literal\u003e. But \u003cliteral\u003e[today,infinity]\u003c/literal\u003e means","html":"- thing as \u0026lt;literal\u0026gt;[today,)\u0026lt;/literal\u0026gt;. But \u0026lt;literal\u0026gt;[today,infinity]\u0026lt;/literal\u0026gt; means","displayNoNewLineWarning":false,"position":35,"left":154,"right":147},{"stylingDirective":null,"type":"DELETION","blobLineNumber":155,"text":"- something different from \u003cliteral\u003e[today,infinity)\u003c/literal\u003e \u0026mdash; the latter","html":"- something different from \u0026lt;literal\u0026gt;[today,infinity)\u0026lt;/literal\u0026gt; \u0026amp;mdash; the latter","displayNoNewLineWarning":false,"position":36,"left":155,"right":147},{"stylingDirective":null,"type":"DELETION","blobLineNumber":156,"text":"- excludes the special \u003ctype\u003etimestamp\u003c/type\u003e value \u003cliteral\u003einfinity\u003c/literal\u003e.","html":"- excludes the special \u0026lt;type\u0026gt;timestamp\u0026lt;/type\u0026gt; value \u0026lt;literal\u0026gt;infinity\u0026lt;/literal\u0026gt;.","displayNoNewLineWarning":false,"position":37,"left":156,"right":147},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":148,"text":"+ Element types that have the notion of \u003cquote\u003einfinity\u003c/quote\u003e can","html":"+ Element types that have the notion of \u0026lt;quote\u0026gt;infinity\u0026lt;/quote\u0026gt; can","displayNoNewLineWarning":false,"position":38,"left":156,"right":148},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":149,"text":"+ use them as explicit bound values. For example, with timestamp","html":"+ use them as explicit bound values. For example, with timestamp","displayNoNewLineWarning":false,"position":39,"left":156,"right":149},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":150,"text":"+ ranges, \u003cliteral\u003e[today,infinity)\u003c/literal\u003e excludes the special","html":"+ ranges, \u0026lt;literal\u0026gt;[today,infinity)\u0026lt;/literal\u0026gt; excludes the special","displayNoNewLineWarning":false,"position":40,"left":156,"right":150},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":151,"text":"+ \u003ctype\u003etimestamp\u003c/type\u003e value \u003cliteral\u003einfinity\u003c/literal\u003e,","html":"+ \u0026lt;type\u0026gt;timestamp\u0026lt;/type\u0026gt; value \u0026lt;literal\u0026gt;infinity\u0026lt;/literal\u0026gt;,","displayNoNewLineWarning":false,"position":41,"left":156,"right":151},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":152,"text":"+ while \u003cliteral\u003e[today,infinity]\u003c/literal\u003e include it, as does","html":"+ while \u0026lt;literal\u0026gt;[today,infinity]\u0026lt;/literal\u0026gt; include it, as does","displayNoNewLineWarning":false,"position":42,"left":156,"right":152},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":153,"text":"+ \u003cliteral\u003e[today,)\u003c/literal\u003e and \u003cliteral\u003e[today,]\u003c/literal\u003e.","html":"+ \u0026lt;literal\u0026gt;[today,)\u0026lt;/literal\u0026gt; and \u0026lt;literal\u0026gt;[today,]\u0026lt;/literal\u0026gt;.","displayNoNewLineWarning":false,"position":43,"left":156,"right":153},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":154,"text":" \u003c/para\u003e","html":" \u0026lt;/para\u0026gt;","displayNoNewLineWarning":false,"position":44,"left":157,"right":154},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":155,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":45,"left":158,"right":155},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":156,"text":" \u003cpara\u003e","html":" \u0026lt;para\u0026gt;","displayNoNewLineWarning":false,"position":46,"left":159,"right":156}],"diffNumber":0,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":522,"linesChanged":37,"newTreeEntry":{"lineCount":522,"path":"doc/src/sgml/rangetypes.sgml","mode":100644,"isGenerated":false},"oldTreeEntry":{"lineCount":0,"path":"doc/src/sgml/rangetypes.sgml","mode":100644},"linesAdded":17,"linesDeleted":20,"path":"doc/src/sgml/rangetypes.sgml","pathDigest":"eb4a769deea1938fe546fecfa4b5658816545da41f4236145f8a142118da443e","status":"MODIFIED","truncatedReason":null,"oldOid":"a052f6cbb84e5630d50b68586cecc127e64be639","newOid":"650692a18d29c44c8019545c02ba42c3efd2c964","copilotChatReference":null,"deletedSha":"a052f6cbb84e5630d50b68586cecc127e64be639","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null}],"splitViewPreference":"unified","ignoreWhitespace":false,"repoOwnerGlobalRelayId":"MDEyOk9yZ2FuaXphdGlvbjE3NzU0Mw==","commentsPreference":"visible","diffLineSpacingPreference":"relaxed","useMonospaceFont":false,"pasteUrlLinkAsPlainText":false,"userNotices":[],"path":"/postgres/postgres/commit/650692a18d29c44c8019545c02ba42c3efd2c964","fileTreeExpanded":true,"headerInfo":{"additions":17,"deletions":20,"filesChanged":1,"filesChangedString":"1"},"moreDiffsToLoad":false,"asyncDiffLoadInfo":{"startIndex":1,"truncated":false,"byteCount":2651,"lineShownCount":47},"commentInfo":{"canComment":false,"locked":false,"canLock":false,"repoArchived":false},"csrf_tokens":{"/users/diffview?diff=split":{"post":"uxFdWU7zaruAfiiCWe4LPcFKp-PDYJeB_wjBixAg5ySb3Blks5xU-nsGnUb5aUqsRndAqWwPsiiZOQ-yrokwlg"},"/users/diffview?diff=unified":{"post":"fVhI4RxAHSWO3WollpKtqzjHKydz0TZCpGwzDS9rMn5dlQzc4S8jZHWl3-E2Few6v_rMbdy-E-vCXf00kcLlzA"},"/notifications/thread":{"post":"X07OS3l0iOgE8D5u9hq6wBmFMXvY-qoJdxDITWpRZf-ZOHvoIqsaU5pAdF6F9rhzTWiwU_qWpE0652pdIdczPQ"}}},"title":"docs: clarify infinite range values from data-type infinities · postgres/postgres@650692a","appPayload":{"helpUrl":"https://docs.github.com","findInDiffWorkerPath":"/assets-cdn/worker/find-in-diff-worker-2bfe39677d14.js","enabled_features":{"diff_ux_refresh_beta":false,"diff_inline_comments":true,"diff_ux_refresh_ssr_five":false,"diff_ux_refresh_ssr_ten":false,"react_diff_line_type_character_correction":true}}}

Commit 650692a

Browse files
committed
docs: clarify infinite range values from data-type infinities
The previous docs referenced these distinct ideas confusingly. Reported-by: Eugen Konkov Discussion: https://postgr.es/m/376945611.20191026161529@yandex.ru Backpatch-through: 9.4
1 parent a052f6c commit 650692a

File tree

1 file changed

+17
-20
lines changed

1 file changed

+17
-20
lines changed

doc/src/sgml/rangetypes.sgml

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -131,29 +131,26 @@ SELECT isempty(numrange(1, 5));
131131
<title>Infinite (Unbounded) Ranges</title>
132132

133133
<para>
134-
The lower bound of a range can be omitted, meaning that all points less
135-
than the upper bound are included in the range. Likewise, if the upper
136-
bound of the range is omitted, then all points greater than the lower bound
137-
are included in the range. If both lower and upper bounds are omitted, all
138-
values of the element type are considered to be in the range.
134+
The lower bound of a range can be omitted, meaning that all
135+
values less than the upper bound are included in the range, e.g.,
136+
<literal>(,3]</literal>. Likewise, if the upper bound of the range
137+
is omitted, then all values greater than the lower bound are included
138+
in the range. If both lower and upper bounds are omitted, all values
139+
of the element type are considered to be in the range. Specifying a
140+
missing bound as inclusive is automatically converted to exclusive,
141+
e.g., <literal>[,]</literal> is converted to <literal>(,)</literal>.
142+
You can think of these missing values as +/-infinity, but they are
143+
special range type values and are considered to be beyond any range
144+
element type's +/-infinity values.
139145
</para>
140146

141147
<para>
142-
This is equivalent to considering that the lower bound is <quote>minus
143-
infinity</quote>, or the upper bound is <quote>plus infinity</quote>,
144-
respectively. But note that these infinite values are never values of
145-
the range's element type, and can never be part of the range. (So there
146-
is no such thing as an inclusive infinite bound &mdash; if you try to
147-
write one, it will automatically be converted to an exclusive bound.)
148-
</para>
149-
150-
<para>
151-
Also, some element types have a notion of <quote>infinity</quote>, but that
152-
is just another value so far as the range type mechanisms are concerned.
153-
For example, in timestamp ranges, <literal>[today,]</literal> means the same
154-
thing as <literal>[today,)</literal>. But <literal>[today,infinity]</literal> means
155-
something different from <literal>[today,infinity)</literal> &mdash; the latter
156-
excludes the special <type>timestamp</type> value <literal>infinity</literal>.
148+
Element types that have the notion of <quote>infinity</quote> can
149+
use them as explicit bound values. For example, with timestamp
150+
ranges, <literal>[today,infinity)</literal> excludes the special
151+
<type>timestamp</type> value <literal>infinity</literal>,
152+
while <literal>[today,infinity]</literal> include it, as does
153+
<literal>[today,)</literal> and <literal>[today,]</literal>.
157154
</para>
158155

159156
<para>

0 commit comments

Comments
 (0)
0