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

Commited3dc22

Browse files
committed
Doc: clarify description of degenerate NATURAL joins.
Claiming that NATURAL JOIN is equivalent to CROSS JOIN when there areno common column names is only strictly correct if it's an inner join;you can't say e.g. CROSS LEFT JOIN. Better to explain it as meaningJOIN ON TRUE, instead. Per a suggestion from David Johnston.Discussion:https://postgr.es/m/CAKFQuwb+mYszQhDS9f_dqRrk1=Pe-S6D=XMkAXcDf4ykKPmgKQ@mail.gmail.com
1 parenteb145fd commited3dc22

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

‎doc/src/sgml/queries.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,8 @@ FROM <replaceable>table_reference</replaceable> <optional>, <replaceable>table_r
391391
consisting of all column names that appear in both
392392
input tables. As with <literal>USING</>, these columns appear
393393
only once in the output table. If there are no common
394-
column names, <literal>NATURAL</literal> behaves like
395-
<literal>CROSSJOIN</literal>.
394+
column names, <literal>NATURAL JOIN</literal> behaves like
395+
<literal>JOIN ... ON TRUE</literal>, producing a cross-product join.
396396
</para>
397397

398398
<note>

‎doc/src/sgml/ref/select.sgml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,9 +603,12 @@ TABLE [ ONLY ] <replaceable class="parameter">table_name</replaceable> [ * ]
603603
<varlistentry>
604604
<term><literal>NATURAL</literal></term>
605605
<listitem>
606-
<para><literal>NATURAL</literal> is shorthand for a
606+
<para>
607+
<literal>NATURAL</literal> is shorthand for a
607608
<literal>USING</> list that mentions all columns in the two
608-
tables that have the same names.
609+
tables that have matching names. If there are no common
610+
column names, <literal>NATURAL</literal> is equivalent
611+
to <literal>ON TRUE</>.
609612
</para>
610613
</listitem>
611614
</varlistentry>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp