Re: Improve examples for range operators

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: kes-kes(at)yandex(dot)ru, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: Improve examples for range operators
Date: 2019-02-22 01:18:14
Message-ID: 20190222011814.gae3a4yjgfyoxa3r@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Wed, Feb 20, 2019 at 12:27:26PM +0000, PG Doc comments form wrote:
> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/11/functions-range.html
> Description:
>
> Hi.
>
> It would be nice if next examples:
>
> << strictly left of int8range(1,10) << int8range(100,110) t
> >> strictly right of int8range(50,60) >> int8range(20,30) t
> &< does not extend to the right of int8range(1,20) &< int8range(18,20)
> t
> &> does not extend to the left of int8range(7,20) &> int8range(5,10) t
>
> are extended by:
> **not** strictly left of, **not** strictly right of, **extends** to the
> right of, **extends** to the left of
>
> Because without manual experiments I can not imagine the ranges that cause
> 'false' result for the examples above.

Well, they are not technically negatives of each other. << means the
first is all left of the second, while &< means that it doesn't go to
the right of the second, e.g.,

SELECT int8range(1,10) &< int8range(100,110);
?column?
----------
t

SELECT int8range(1,105) &< int8range(100,110);
?column?
----------
t

SELECT int8range(1,200) &< int8range(100,110);
?column?
----------
f

Notice it changed from true to false and none of these was strictly to
the right.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ As you are, so once was I. As I am, so you will be. +
+ Ancient Roman grave inscription +

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Bruce Momjian 2019-02-22 01:39:24 Re: Improve documentation for current_setting function
Previous Message Peter Eisentraut 2019-02-20 16:28:50 Re: First SVG graphic