Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbc9993a

Browse files
committed
Doc: improve description of IN and row-constructor comparisons.
IN and NOT IN work fine on records and arrays, so just say thatthey accept "expressions" not "scalar expressions". I think thatthat phrasing was meant to say that they don't work on set-returningexpressions, but that's not the common meaning of "scalar".Revise the description of row-constructor comparisons to make itperhaps a bit less confusing. (This partially reverts somedubious wording changes made by commitf566515.)Per gripe from Ilya Nenashev. Back-patch to supported branches.In HEAD and v16, also drop a NOTE about pre-8.2 behavior, whichis hopefully no longer of interest to anybody.Discussion:https://postgr.es/m/168968062460.632.14303906825812821399@wrigleys.postgresql.org
1 parentf9278cb commitbc9993a

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

‎doc/src/sgml/func.sgml

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21600,7 +21600,7 @@ WHERE EXISTS (SELECT 1 FROM tab2 WHERE col2 = tab1.col2);
2160021600

2160121601
<para>
2160221602
The right-hand side is a parenthesized list
21603-
ofscalarexpressions. The result is <quote>true</quote> if the left-hand expression's
21603+
of expressions. The result is <quote>true</quote> if the left-hand expression's
2160421604
result is equal to any of the right-hand expressions. This is a shorthand
2160521605
notation for
2160621606

@@ -21631,7 +21631,7 @@ OR
2163121631

2163221632
<para>
2163321633
The right-hand side is a parenthesized list
21634-
ofscalarexpressions. The result is <quote>true</quote> if the left-hand expression's
21634+
of expressions. The result is <quote>true</quote> if the left-hand expression's
2163521635
result is unequal to all of the right-hand expressions. This is a shorthand
2163621636
notation for
2163721637

@@ -21742,26 +21742,24 @@ AND
2174221742
<para>
2174321743
Each side is a row constructor,
2174421744
as described in <xref linkend="sql-syntax-row-constructors"/>.
21745-
The two row values must have the same number of fields.
21746-
Each side is evaluated and they are compared row-wise. Row constructor
21747-
comparisons are allowed when the <replaceable>operator</replaceable> is
21745+
The two row constructors must have the same number of fields.
21746+
The given <replaceable>operator</replaceable> is applied to each pair
21747+
of corresponding fields. (Since the fields could be of different
21748+
types, this means that a different specific operator could be selected
21749+
for each pair.)
21750+
All the selected operators must be members of some B-tree operator
21751+
class, or be the negator of an <literal>=</literal> member of a B-tree
21752+
operator class, meaning that row constructor comparison is only
21753+
possible when the <replaceable>operator</replaceable> is
2174821754
<literal>=</literal>,
2174921755
<literal>&lt;&gt;</literal>,
2175021756
<literal>&lt;</literal>,
2175121757
<literal>&lt;=</literal>,
21752-
<literal>&gt;</literal> or
21753-
<literal>&gt;=</literal>.
21754-
Every row element must be of a type which has a default B-tree operator
21755-
class or the attempted comparison may generate an error.
21758+
<literal>&gt;</literal>, or
21759+
<literal>&gt;=</literal>,
21760+
or has semantics similar to one of these.
2175621761
</para>
2175721762

21758-
<note>
21759-
<para>
21760-
Errors related to the number or types of elements might not occur if
21761-
the comparison is resolved using earlier columns.
21762-
</para>
21763-
</note>
21764-
2176521763
<para>
2176621764
The <literal>=</literal> and <literal>&lt;&gt;</literal> cases work slightly differently
2176721765
from the others. Two rows are considered

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp