pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Possible typos in the #12.1.1 examples
3+ messages / 3 participants
[nested] [flat]

* Possible typos in the #12.1.1 examples
@ 2020-03-02 15:38  PG Doc comments form <noreply@postgresql.org>
  0 siblings, 1 reply; 3+ messages in thread

From: PG Doc comments form @ 2020-03-02 15:38 UTC (permalink / raw)
  To: pgsql-docs@lists.postgresql.org; +Cc: axykon@gmail.com

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/12/textsearch-intro.html
Description:

SELECT title || ' ' ||  author || ' ' ||  abstract || ' ' || body AS
document
FROM messages
WHERE mid = 12;

Seems like here the example missed 'm' as an alias and a dot in the `where`
clause:
... messages m
... m.id = 12;


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;

Thanks!


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Possible typos in the #12.1.1 examples
@ 2020-03-05 07:45  Michael Paquier <michael@paquier.xyz>
  parent: PG Doc comments form <noreply@postgresql.org>
  0 siblings, 1 reply; 3+ messages in thread

From: Michael Paquier @ 2020-03-05 07:45 UTC (permalink / raw)
  To: axykon@gmail.com; pgsql-docs@lists.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

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Possible typos in the #12.1.1 examples
@ 2020-03-21 00:19  Bruce Momjian <bruce@momjian.us>
  parent: Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 3+ messages in thread

From: Bruce Momjian @ 2020-03-21 00:19 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; +Cc: axykon@gmail.com; pgsql-docs@lists.postgresql.org

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  <bruce@momjian.us>        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 +





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2020-03-21 00:19 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-03-02 15:38 Possible typos in the #12.1.1 examples PG Doc comments form <noreply@postgresql.org>
2020-03-05 07:45 ` Michael Paquier <michael@paquier.xyz>
2020-03-21 00:19   ` Bruce Momjian <bruce@momjian.us>

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