Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id A453EB5DBE1 for ; Tue, 17 May 2011 22:52:43 -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 14466-02 for ; Wed, 18 May 2011 01:52:35 +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 ABBE8B5DBDF for ; Tue, 17 May 2011 22:52:35 -0300 (ADT) Received: by iyb14 with SMTP id 14so910122iyb.19 for ; Tue, 17 May 2011 18:52:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=KXxQ9hjHREKEGdYNgrbjjI/pS01uRWrpL+y2buM0C84=; b=VpsnvMvVzfQNYD3q5BJK4FqvW+mVXmH+ECuIN8H69fOFQwWdprP9ncFH69v6ApmLgP R6Yjmy80OLPkgC0V4hWPb6j9KPHCYv4q83SPeXyZassShtJW1jdz2H6Ahy79eNQbU+gl umVFxFsmTHfmCV86J51hSqeJNczGWhLP/NqAQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=r5ZDNy2cOq1Cm8TRBfg8djvegKCnuoF9133E2/9j4OqUmPHA5EmAv2nUTQbFfsLMd8 WKosM0+KJg1Kfuss5uR60ZQ56c/bbHnQQQuMaCZIBwBakKOsT118l9zwqcvmKgDLzTbc 8jWzd3pbhhB6ul8BnmLNLEQ7II8QJ0s86eHvw= MIME-Version: 1.0 Received: by 10.231.21.146 with SMTP id j18mr1058999ibb.24.1305683555578; Tue, 17 May 2011 18:52:35 -0700 (PDT) Received: by 10.231.33.65 with HTTP; Tue, 17 May 2011 18:52:35 -0700 (PDT) In-Reply-To: References: Date: Wed, 18 May 2011 03:52:35 +0200 Message-ID: Subject: Re: 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-Spam-Status: No, hits=-1.888 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RFC_ABUSE_POST=0.001, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201105/55 X-Sequence-Number: 6730 2011/5/18 Grzegorz Szpetkowski : > 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 > My mistake "NATURAL JOIN", better is to just write "NATURAL". thanks & regards, greg szpetkowski