@ -22127,7 +22127,7 @@ WHERE EXISTS (SELECT 1 FROM tab2 WHERE col2 = tab1.col2);
<para>
<para>
The right-hand side is a parenthesized list
The right-hand side is a parenthesized list
of scalar expressions. The result is <quote>true</quote> if the left-hand expression's
of expressions. The result is <quote>true</quote> if the left-hand expression's
result is equal to any of the right-hand expressions. This is a shorthand
result is equal to any of the right-hand expressions. This is a shorthand
notation for
notation for
@ -22158,7 +22158,7 @@ OR
<para>
<para>
The right-hand side is a parenthesized list
The right-hand side is a parenthesized list
of scalar expressions. The result is <quote>true</quote> if the left-hand expression's
of expressions. The result is <quote>true</quote> if the left-hand expression's
result is unequal to all of the right-hand expressions. This is a shorthand
result is unequal to all of the right-hand expressions. This is a shorthand
notation for
notation for
@ -22269,26 +22269,24 @@ AND
<para>
<para>
Each side is a row constructor,
Each side is a row constructor,
as described in <xref linkend="sql-syntax-row-constructors"/>.
as described in <xref linkend="sql-syntax-row-constructors"/>.
The two row values must have the same number of fields.
The two row constructors must have the same number of fields.
Each side is evaluated and they are compared row-wise. Row constructor
The given <replaceable>operator</replaceable> is applied to each pair
comparisons are allowed when the <replaceable>operator</replaceable> is
of corresponding fields. (Since the fields could be of different
types, this means that a different specific operator could be selected
for each pair.)
All the selected operators must be members of some B-tree operator
class, or be the negator of an <literal>=</literal> member of a B-tree
operator class, meaning that row constructor comparison is only
possible when the <replaceable>operator</replaceable> is
<literal>=</literal>,
<literal>=</literal>,
<literal><></literal>,
<literal><></literal>,
<literal><</literal>,
<literal><</literal>,
<literal><=</literal>,
<literal><=</literal>,
<literal>></literal> or
<literal>></literal>, or
<literal>>=</literal>.
<literal>>=</literal>,
Every row element must be of a type which has a default B-tree operator
or has semantics similar to one of these.
class or the attempted comparison may generate an error.
</para>
</para>
<note>
<para>
Errors related to the number or types of elements might not occur if
the comparison is resolved using earlier columns.
</para>
</note>
<para>
<para>
The <literal>=</literal> and <literal><></literal> cases work slightly differently
The <literal>=</literal> and <literal><></literal> cases work slightly differently
from the others. Two rows are considered
from the others. Two rows are considered
@ -22309,19 +22307,6 @@ AND
considered.
considered.
</para>
</para>
<note>
<para>
Prior to <productname>PostgreSQL</productname> 8.2, the
<literal><</literal>, <literal><=</literal>, <literal>></literal> and <literal>>=</literal>
cases were not handled per SQL specification. A comparison like
<literal>ROW(a,b) < ROW(c,d)</literal>
was implemented as
<literal>a < c AND b < d</literal>
whereas the correct behavior is equivalent to
<literal>a < c OR (a = c AND b < d)</literal>.
</para>
</note>
<synopsis>
<synopsis>
<replaceable>row_constructor</replaceable> IS DISTINCT FROM <replaceable>row_constructor</replaceable>
<replaceable>row_constructor</replaceable> IS DISTINCT FROM <replaceable>row_constructor</replaceable>
</synopsis>
</synopsis>