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

Commit8286b43

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 parent2e9135b commit8286b43

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
@@ -21185,7 +21185,7 @@ WHERE EXISTS (SELECT 1 FROM tab2 WHERE col2 = tab1.col2);
2118521185

2118621186
<para>
2118721187
The right-hand side is a parenthesized list
21188-
ofscalarexpressions. The result is <quote>true</quote> if the left-hand expression's
21188+
of expressions. The result is <quote>true</quote> if the left-hand expression's
2118921189
result is equal to any of the right-hand expressions. This is a shorthand
2119021190
notation for
2119121191

@@ -21216,7 +21216,7 @@ OR
2121621216

2121721217
<para>
2121821218
The right-hand side is a parenthesized list
21219-
ofscalarexpressions. The result is <quote>true</quote> if the left-hand expression's
21219+
of expressions. The result is <quote>true</quote> if the left-hand expression's
2122021220
result is unequal to all of the right-hand expressions. This is a shorthand
2122121221
notation for
2122221222

@@ -21327,26 +21327,24 @@ AND
2132721327
<para>
2132821328
Each side is a row constructor,
2132921329
as described in <xref linkend="sql-syntax-row-constructors"/>.
21330-
The two row values must have the same number of fields.
21331-
Each side is evaluated and they are compared row-wise. Row constructor
21332-
comparisons are allowed when the <replaceable>operator</replaceable> is
21330+
The two row constructors must have the same number of fields.
21331+
The given <replaceable>operator</replaceable> is applied to each pair
21332+
of corresponding fields. (Since the fields could be of different
21333+
types, this means that a different specific operator could be selected
21334+
for each pair.)
21335+
All the selected operators must be members of some B-tree operator
21336+
class, or be the negator of an <literal>=</literal> member of a B-tree
21337+
operator class, meaning that row constructor comparison is only
21338+
possible when the <replaceable>operator</replaceable> is
2133321339
<literal>=</literal>,
2133421340
<literal>&lt;&gt;</literal>,
2133521341
<literal>&lt;</literal>,
2133621342
<literal>&lt;=</literal>,
21337-
<literal>&gt;</literal> or
21338-
<literal>&gt;=</literal>.
21339-
Every row element must be of a type which has a default B-tree operator
21340-
class or the attempted comparison may generate an error.
21343+
<literal>&gt;</literal>, or
21344+
<literal>&gt;=</literal>,
21345+
or has semantics similar to one of these.
2134121346
</para>
2134221347

21343-
<note>
21344-
<para>
21345-
Errors related to the number or types of elements might not occur if
21346-
the comparison is resolved using earlier columns.
21347-
</para>
21348-
</note>
21349-
2135021348
<para>
2135121349
The <literal>=</literal> and <literal>&lt;&gt;</literal> cases work slightly differently
2135221350
from the others. Two rows are considered

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp