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: Ambiguous usage of 'any' in explanation |
Date: | 2018-10-11 21:09:34 |
Message-ID: | 20181011210934.GG7807@momjian.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-docs |
On Sat, Sep 15, 2018 at 11:53:47AM +0000, PG Doc comments form wrote:
> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/10/static/functions-subquery.html
> Description:
>
> Hi.
>
> The [DOC](https://www.postgresql.org/docs/10/static/functions-subquery.html)
> says:
>
> The result is NULL if the comparison does not return false for any
> subquery row
>
> does *any* mean here: some or all?
>
> For example in
> [MySQL](https://dev.mysql.com/doc/refman/8.0/en/any-in-some-subqueries.html)
> I have found this explanation:
>
> >Use of the word SOME is rare, but this example shows why it might be
> useful. To most people, the English phrase “a is not equal to any b” means
> “there is no b which is equal to a,” but that is not what is meant by the
> SQL syntax. The syntax means “there is some b to which a is not equal.”
> Using <> SOME instead helps ensure that everyone understands the true
> meaning of the query.
I am kind of confused by this report. You mention SOME in the text
above, which is a synonym for ANY, but the text you quote:
> The result is NULL if the comparison does not return false for any
> subquery row
is from ALL:
The result of <token>ALL</token> is <quote>true</quote> if
the comparison returns true for all subquery rows (including
the case where the subquery returns no rows). The result is
<quote>false</quote> if the comparison returns false for any
subquery row. The result is NULL if the comparison does not
return false for any subquery row, and it returns NULL for at
least one row.
I see the last line is just trying to negate the line above it, but the
mix of "not" and "any" is confusing. I can reword this last line to be:
The result is NULL if no comparison with a subquery row returns
false, and it returns NULL for at least one row.
I can make similar adjustments in other places, and have attached a doc
patch. Does that help?
--
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 +
Attachment | Content-Type | Size |
---|---|---|
any.diff | text/x-diff | 1.6 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | David G. Johnston | 2018-10-11 21:20:07 | Re: Ambiguous usage of 'any' in explanation |
Previous Message | David G. Johnston | 2018-10-11 19:51:27 | Re: please inform data_directory |