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 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-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/54 X-Sequence-Number: 6729 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