pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: axykon@gmail.com
To: pgsql-docs@lists.postgresql.org
Subject: Re: Possible typos in the #12.1.1 examples
Date: Thu, 5 Mar 2020 16:45:23 +0900
Message-ID: <20200305074523.GX2593@paquier.xyz> (raw)
In-Reply-To: <158316348159.30450.16075357948244298217@wrigleys.postgresql.org>
References: <158316348159.30450.16075357948244298217@wrigleys.postgresql.org>

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.
--
Michael

Attachments:

  [application/pgp-signature] signature.asc (832B, ../20200305074523.GX2593@paquier.xyz/2-signature.asc)
  download

view thread (3+ messages)  latest in thread

Message-ID: <20200305074523.GX2593@paquier.xyz>
Permalink:  ../20200305074523.GX2593@paquier.xyz/
Also on:    postgresql.org/message-id/20200305074523.GX2593@paquier.xyz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: michael@paquier.xyz, axykon@gmail.com, pgsql-docs@lists.postgresql.org
  Subject: Re: Possible typos in the #12.1.1 examples
  In-Reply-To: <20200305074523.GX2593@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox