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

Commit27e9459

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 parentdc2d9ef commit27e9459

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

2035320353
<para>
2035420354
The right-hand side is a parenthesized list
20355-
ofscalarexpressions. The result is <quote>true</quote> if the left-hand expression's
20355+
of expressions. The result is <quote>true</quote> if the left-hand expression's
2035620356
result is equal to any of the right-hand expressions. This is a shorthand
2035720357
notation for
2035820358

@@ -20383,7 +20383,7 @@ OR
2038320383

2038420384
<para>
2038520385
The right-hand side is a parenthesized list
20386-
ofscalarexpressions. The result is <quote>true</quote> if the left-hand expression's
20386+
of expressions. The result is <quote>true</quote> if the left-hand expression's
2038720387
result is unequal to all of the right-hand expressions. This is a shorthand
2038820388
notation for
2038920389

@@ -20494,26 +20494,24 @@ AND
2049420494
<para>
2049520495
Each side is a row constructor,
2049620496
as described in <xref linkend="sql-syntax-row-constructors"/>.
20497-
The two row values must have the same number of fields.
20498-
Each side is evaluated and they are compared row-wise. Row constructor
20499-
comparisons are allowed when the <replaceable>operator</replaceable> is
20497+
The two row constructors must have the same number of fields.
20498+
The given <replaceable>operator</replaceable> is applied to each pair
20499+
of corresponding fields. (Since the fields could be of different
20500+
types, this means that a different specific operator could be selected
20501+
for each pair.)
20502+
All the selected operators must be members of some B-tree operator
20503+
class, or be the negator of an <literal>=</literal> member of a B-tree
20504+
operator class, meaning that row constructor comparison is only
20505+
possible when the <replaceable>operator</replaceable> is
2050020506
<literal>=</literal>,
2050120507
<literal>&lt;&gt;</literal>,
2050220508
<literal>&lt;</literal>,
2050320509
<literal>&lt;=</literal>,
20504-
<literal>&gt;</literal> or
20505-
<literal>&gt;=</literal>.
20506-
Every row element must be of a type which has a default B-tree operator
20507-
class or the attempted comparison may generate an error.
20510+
<literal>&gt;</literal>, or
20511+
<literal>&gt;=</literal>,
20512+
or has semantics similar to one of these.
2050820513
</para>
2050920514

20510-
<note>
20511-
<para>
20512-
Errors related to the number or types of elements might not occur if
20513-
the comparison is resolved using earlier columns.
20514-
</para>
20515-
</note>
20516-
2051720515
<para>
2051820516
The <literal>=</literal> and <literal>&lt;&gt;</literal> cases work slightly differently
2051920517
from the others. Two rows are considered

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp