Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kE5au-0004aD-VG for pgsql-docs@arkaria.postgresql.org; Fri, 04 Sep 2020 06:53:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kE5as-0000RO-TW for pgsql-docs@arkaria.postgresql.org; Fri, 04 Sep 2020 06:53:06 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kE5as-0000RG-0U for pgsql-docs@lists.postgresql.org; Fri, 04 Sep 2020 06:53:06 +0000 Received: from wforward1-smtp.messagingengine.com ([64.147.123.30]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kE5ao-00008r-PD for pgsql-docs@lists.postgresql.org; Fri, 04 Sep 2020 06:53:04 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailforward.west.internal (Postfix) with ESMTP id E8808A22; Fri, 4 Sep 2020 02:52:59 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 04 Sep 2020 02:53:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=2oo9hDR8PeVIVAbEIkDMRwkwk4Tqj/rKANtp4IJEr 3U=; b=HVfcA2ujp03I0RJ0ed+jxL4cRiQ1q0V5qb8fbrzZhjC4D5gGawsSr+zei yuKSR/0ANCgpJk+XdBOGaHGJIMvFsB1Xhyj1KhiEUmv9tJ0I70e8aoarSD3fX4QN +EnXD0FwGKkAg+OIGhQg6S0KXmAy8+12cxPome9On8rbKQJrddNJew9/YYlmdbzE rTOF5DyflSiSxHbpo6EIWHT62ovXv7r6b2dEOqdDVvSLtD0annj9zBssFf6ybCeY VMSh/5GR0rJuaFU5GqyesBeE79sXO4zNJFKR0niaT1DUDtZwWLF2TzzZi7nlfu5J jAu5jJUJOJ3Db5kZLX8dKRvZ5C36w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudegvddguddufecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefuvfhfhfhokffffgggjggtgfesthekredttdefjeenucfhrhhomheprfgv thgvrhcugfhishgvnhhtrhgruhhtuceophgvthgvrhdrvghishgvnhhtrhgruhhtsedvnh guqhhurggurhgrnhhtrdgtohhmqeenucggtffrrghtthgvrhhnpeelffffteffjeefhfeh ffevkeeiteeikedufeffhfehveeilefhtefhgeefudehtdenucffohhmrghinhepvdhnug hquhgrughrrghnthdrtghomhenucfkphepledurddugedrvdeffedrfeefnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhdrvghish gvnhhtrhgruhhtsedvnhguqhhurggurhgrnhhtrdgtohhm X-ME-Proxy: Received: from april.pezone.net (p5b0ee921.dip0.t-ipconnect.de [91.14.233.33]) by mail.messagingengine.com (Postfix) with ESMTPA id F2CC83060062; Fri, 4 Sep 2020 02:52:57 -0400 (EDT) Subject: Re: Change JOIN tutorial to focus more on explicit joins To: =?UTF-8?Q?J=c3=bcrgen_Purtz?= , Thomas Munro , shammat@gmx.net, pgsql-docs@lists.postgresql.org References: <158996922318.7035.10603922579567326239@wrigleys.postgresql.org> From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: <9fd4b399-37c8-014e-e7ef-08fb0ecbbdcc@2ndquadrant.com> Date: Fri, 4 Sep 2020 08:52:56 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-05-27 10:29, Jürgen Purtz wrote: > The attached patch > > - prefers the explicit join-syntax over the implicit one and explains > the keywords of the explicit syntax > > - uses a more accurate definition of 'join' > > - separates and tags > > - shifts definitions outside of to get a better > rendering in PDF > > - adds a note concerning IDs and foreign keys I have committed some parts of this patch: > - separates and tags > - shifts definitions outside of to get a better > rendering in PDF as well as the change of W1/W2 to w1/w2. (Note that there is also src/tutorial/basics.source that should be adjusted in the same way.) For the remaining patch I have a couple of concerns: > > Attempt to determine the semantics of this query when the > - WHERE clause is omitted. > + ON clause is omitted. > > This no longer works. In general, I agree that some more emphasis on the JOIN syntax is okay. But I think the order in which the tutorial has taught it so far is okay: First you do it the manual way, then you learn the more abstract way. > + > + > + The examples shown here combine rows via city names. > + This should help to understand the concept. Professional > + solutions prefer to use numerical IDs and foreign keys > + to join tables. > + > + While there are interesting debates to be had about natural vs. surrogate keys, I don't think we should imply that one of them is unprofessional and then leave it at that and give no further guidance. I think we should leave this out. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services