From: | Ben Koshy <benkoshy(at)hotmail(dot)com> |
---|---|
To: | Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, "pgsql-docs(at)lists(dot)postgresql(dot)org" <pgsql-docs(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Comparison Predicates - example - documentation seems contradictory? |
Date: | 2022-10-07 21:52:34 |
Message-ID: | DM6PR13MB35471D480DE17E5F02709E94C05F9@DM6PR13MB3547.namprd13.prod.outlook.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-docs |
you're 100% right. Got it now. The documentation is correct and does not need to be changed. chrs.
________________________________
From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Sent: Friday, 7 October 2022 7:49 PM
To: benkoshy(at)hotmail(dot)com <benkoshy(at)hotmail(dot)com>; pgsql-docs(at)lists(dot)postgresql(dot)org <pgsql-docs(at)lists(dot)postgresql(dot)org>
Subject: Re: Comparison Predicates - example - documentation seems contradictory?
On 2022-Oct-06, PG Doc comments form wrote:
> See the heading: "Table 9.2. Comparison Predicates"
>
> "2 BETWEEN 3 AND 1 → f" # ok this is false.
>
> But let's read the example immediately below (the 'not between' example)
>
> 2 NOT BETWEEN 1 AND 3 → f # what? This is also false. how can the negation
> also be the same value? I would expect it to be true?
Actually, 2 *is* between 1 and 3. So if you ask if it's NOT between,
that's false.
The other one is false because the boundaries are reversed, and BETWEEN
does not put them in the proper order before comparing. BETWEEN
SYMMETRIC does that, as explained in the line below.
From | Date | Subject | |
---|---|---|---|
Next Message | Noah Misch | 2022-10-09 13:21:43 | Re: SQL-standard function bodies and creating SECURITY DEFINER routines securely |
Previous Message | Ekaterina Kiryanova | 2022-10-07 14:53:47 | Minor inconsistencies |