Re: Change JOIN tutorial to focus more on explicit joins

Peter Eisentraut <peter.eisentraut@2ndquadrant.com>

From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Jürgen Purtz <juergen@purtz.de>, Thomas Munro <thomas.munro@gmail.com>, shammat@gmx.net, pgsql-docs@lists.postgresql.org
Date: 2020-09-04T06:52:56Z
Lists: pgsql-hackers, pgsql-docs
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 <programlisting> and <screen> tags
> 
> - shifts <indexterm> definitions outside of <para> to get a better
> rendering in PDF
> 
> - adds a note concerning IDs and foreign keys

I have committed some parts of this patch:

 > - separates <programlisting> and <screen> tags

 > - shifts <indexterm> definitions outside of <para> 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:

 >      <para>
 >       Attempt to determine the semantics of this query when the
 > -     <literal>WHERE</literal> clause is omitted.
 > +     <literal>ON</literal> clause is omitted.
 >      </para>
 >     </formalpara>

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.

 > +   <note>
 > +    <para>
 > +     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.
 > +    </para>
 > +   </note>

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



Commits

  1. doc: Prefer explicit JOIN syntax over old implicit syntax in tutorial

  2. doc: Change table alias names to lower case in tutorial chapter

  3. doc: Fix whitespace issue in PDF

  4. doc: Use tags consistently in the tutorial chapter