Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 58A1DB5DBE7 for ; Thu, 19 May 2011 22:27:30 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 52638-05 for ; Fri, 20 May 2011 01:27:23 +0000 (UTC) X-Greylist: delayed 03:09:45.760076 by SQLgrey-1.7.6 Received: from mxdfbx01i.wellsfargo.com (mxdfbx01e.wellsfargo.com [167.138.239.83]) by mail.postgresql.org (Postfix) with ESMTP id 64DE2B5DBDE for ; Thu, 19 May 2011 22:27:21 -0300 (ADT) Received: from mxdcmx01i.wellsfargo.com (mxdcmx01i.wellsfargo.com [167.138.205.18]) by mxdfbx01i.wellsfargo.com (Switch-3.4.3/Switch-3.4.3) with ESMTP id p4JMHexW018637 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 19 May 2011 22:17:40 GMT Received: from mxicmx01.wellsfargo.com (mxicmx01.wellsfargo.com [162.102.137.58]) by mxdcmx01i.wellsfargo.com (Switch-3.4.3/Switch-3.4.3) with ESMTP id p4JMHYYK003191 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Thu, 19 May 2011 22:17:34 GMT Received: from mxiinv01.wellsfargo.com (mxiinv01.wellsfargo.com [10.91.24.77]) by mxicmx01.wellsfargo.com (Switch-3.4.3/Switch-3.4.3) with ESMTP id p4JMHW6q010423 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 19 May 2011 22:17:33 GMT Received: from mxv09.wellsfargo.com (mxv09.wellsfargo.com [10.91.29.162]) by mxiinv01.wellsfargo.com (Switch-3.4.3/Switch-3.4.3) with ESMTP id p4JMHW2S015596; Thu, 19 May 2011 22:17:32 GMT Received: from mxv09.wellsfargo.com (localhost [127.0.0.1]) by mxv09.wellsfargo.com (Switch-3.3.2/Switch-3.3.2) with ESMTP id p4JMHVlh003198; Thu, 19 May 2011 17:17:31 -0500 Received: (from root@localhost) by mxv09.wellsfargo.com (Switch-3.3.2/Switch-3.3.0/Submit) id p4JMHVmf003186 for shieldj@wellsfargo.com; Thu, 19 May 2011 17:17:31 -0500 Message-Id: <201105192217.p4JMHVmf003186@mxv09.wellsfargo.com> turn-Path: Received: from [127.0.0.1] by mxissx91.wellsfargo.com with LMTPS (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 18 May 2011 01:47:14 +0000 Received: from mxdinv04i.wellsfargo.com (mxdinv04i.wellsfargo.com [151.151.26.151]) by mxissx91.wellsfargo.com (Switch-3.4.3/Switch-3.4.3) with ESMTP id p4I1lDfc016630 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 18 May 2011 01:47:14 GMT Received: from mx2.hub.org (mx2.hub.org [200.46.204.254]) by mxdinv04i.wellsfargo.com (Switch-3.4.3/Switch-3.4.3) with ESMTP id p4I1lDDq028678 for ; Wed, 18 May 2011 01:47:13 GMT Received: from postgresql.org (mail.postgresql.org [200.46.204.86]) by mx2.hub.org (Postfix) with ESMTP id 8B2243EABE23; Tue, 17 May 2011 22:47:10 -0300 (ADT) Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id F0AFDB5DBDF for ; Tue, 17 May 2011 22:47:08 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 67963-06 for ; Wed, 18 May 2011 01:47:01 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-iy0-f174.google.com (mail-iy0-f174.google.com [209.85.210.174]) by mail.postgresql.org (Postfix) with ESMTP id 067D9B5DBDC for ; Tue, 17 May 2011 22:47:00 -0300 (ADT) Received: by iyb14 with SMTP id 14so907197iyb.19 for ; Tue, 17 May 2011 18:47:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=+jfl+M9k4nsJrD4T0Bk8ZIUab86ih6fsEzFuquEwq/E=; b=RKEAiliTFdLh5Js+k6c+ycCtOId1uEClDMkzYfSK4JrNQev3K5/5zhQmpiBuMVXvga spE7kAgf2/ThFYjrZufQ+SGq9yZZrrcU9zKwItSsHRpjokNDd35Uo3RBprn83l8xgsJr GPGoYYUqad1Y4xEYqW+5Q+CftYCLh9ur//UXo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=QVCYwkwL5NQ1o2gVlUu/RfC6bCucrLAMu9/bE1FgHV4l5SDbvX/6GeTaBA+02QoZFw bOh1Y/PrjRBx0aZ+w0ojfPZTxq9tHOwOCSRevakUdzVRaGk4PtLJd9mgdMJBcS0C0peW /8p/+cbvnC2HymMsnbIcK1ue4iKYe0wjXcaFg= MIME-Version: 1.0 Received: by 10.42.157.67 with SMTP id c3mr1435734icx.95.1305683220822; Tue, 17 May 2011 18:47:00 -0700 (PDT) Received: by 10.231.33.65 with HTTP; Tue, 17 May 2011 18:47:00 -0700 (PDT) Date: Wed, 18 May 2011 03:47:00 +0200 X-WFB-Orig-Message-ID: Subject: 7.2. Table Expressions suggestion about NATURAL JOIN From: Grzegorz Szpetkowski To: pgsql-docs@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Mailing-List: pgsql-docs Precedence: bulk X-MM-CM-Score: 0.00% X-MM-CM-Analysis: v=1.1 cv=HgEw/6DmTUDkGkEd037hiLO25/nMGoDs5vW0jvSbJg4= c=1 sm=1 a=YpqIjoUlJvIA:10 a=nDghuxUhq_wA:10 a=8nJEP1OIZ-IA:10 a=mFCjv411GZ7KNCo3Y9W3fQ==:17 a=epTmVMiNAAAA:8 a=bTwmxvDraBYKP3BK4lgA:9 a=TINZAeVMqngPscPYbYcA:7 a=wPNLvfGTeEIA:10 a=UW-Nxq6YWcYA:10 a=JnxXk8t3QQkA:10 a=YObXiYvaVLwA:10 a=mFCjv411GZ7KNCo3Y9W3fQ==:117 X-MM-CT-Classification: not spam X-MM-CT-RefID: str=0001.0A090208.4DD32521.00C2:SCFMA507887, ss=1, re=-4.000, fgs=0 X-SMI-MM-WFB-Virus-Classification: Unscannable X-WFB-Orig-Env-Recipients: shieldj@wellsfargo.com X-WFB-Orig-Hdr-To: pgsql-docs@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.887 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, MSGID_FROM_MTA_HEADER=0.001, RFC_ABUSE_POST=0.001, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201105/69 X-Sequence-Number: 6744 http://www.postgresql.org/docs/9.0/static/queries-table-expressions.html http://www.postgresql.org/docs/9.0/static/sql-select.html Respectively: "Finally, NATURAL is a shorthand form of USING: it forms a USING list consisting of all column names that appear in both input tables. As with USING, these columns appear only once in the output table." and "NATURAL is shorthand for a USING list that mentions all columns in the two tables that have the same names." To make that comprehensive you can add something like: "Note that if there is no any "shared" column between tables, then NATURAL JOIN acts like ON TRUE (that is, tables are cross-joined)", because it's not obvious. thanks & regards, greg szpetkowski -- Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-docs