Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jFRrv-0007qK-Hf for pgsql-docs@arkaria.postgresql.org; Sat, 21 Mar 2020 00:20:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jFRru-0007eD-Ac for pgsql-docs@arkaria.postgresql.org; Sat, 21 Mar 2020 00:20:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jFRru-0007ds-3X for pgsql-docs@lists.postgresql.org; Sat, 21 Mar 2020 00:20:02 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jFRrr-0000Ca-8z for pgsql-docs@lists.postgresql.org; Sat, 21 Mar 2020 00:20:01 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1jFRro-0001CN-8D; Fri, 20 Mar 2020 20:19:56 -0400 Date: Fri, 20 Mar 2020 20:19:56 -0400 From: Bruce Momjian To: Michael Paquier Cc: axykon@gmail.com, pgsql-docs@lists.postgresql.org Subject: Re: Possible typos in the #12.1.1 examples Message-ID: <20200321001956.GB10066@momjian.us> References: <158316348159.30450.16075357948244298217@wrigleys.postgresql.org> <20200305074523.GX2593@paquier.xyz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200305074523.GX2593@paquier.xyz> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, Mar 5, 2020 at 04:45:23PM +0900, Michael Paquier wrote: > On Mon, Mar 02, 2020 at 03:38:01PM +0000, PG Doc comments form wrote: > > Seems like here the example missed 'm' as an alias and a dot in the `where` > > clause: > > ... messages m > > ... m.id = 12; > > This query is valid as-is. > > > SELECT m.title || ' ' || m.author || ' ' || m.abstract || ' ' || d.body AS > > document > > FROM messages m, docs d > > WHERE mid = did AND mid = 12; > > > > Possibly, the example missed dots: > > ... m.id = d.id AND m.id = 12; > > This one is actually valid as well, as long as both relations don't > use the same column names, but I can see your point to add the aliases > to the quals of the WHERE clause to bring more clarity. Agreed, alias added in all supported branches. -- Bruce Momjian https://momjian.us EnterpriseDB https://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription +