pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feedDOC not so clear
4+ messages / 4 participants
[nested] [flat]
* DOC not so clear
@ 2019-01-14 14:42 PG Doc comments form <noreply@postgresql.org>
0 siblings, 1 reply; 4+ messages in thread
From: PG Doc comments form @ 2019-01-14 14:42 UTC (permalink / raw)
To: pgsql-docs@lists.postgresql.org; +Cc: kes-kes@yandex.ru
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/11/queries-table-expressions.html
Description:
Hi.
https://www.postgresql.org/docs/current/queries-table-expressions.html#QUERIES-LATERAL
>The resulting row(s) are joined as usual with the rows they were computed
from.
Here is not so clear what 'joined as usual' mean.
Probably DOC should explicitly say that if LATERAL function return empty set
then current row is excluded from result set
Please clarify doc a bit.
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: DOC not so clear
@ 2019-01-14 16:15 Tom Lane <tgl@sss.pgh.pa.us>
parent: PG Doc comments form <noreply@postgresql.org>
0 siblings, 1 reply; 4+ messages in thread
From: Tom Lane @ 2019-01-14 16:15 UTC (permalink / raw)
To: kes-kes@yandex.ru; +Cc: pgsql-docs@lists.postgresql.org
=?utf-8?q?PG_Doc_comments_form?= <noreply@postgresql.org> writes:
> https://www.postgresql.org/docs/current/queries-table-expressions.html#QUERIES-LATERAL
>> The resulting row(s) are joined as usual with the rows they were computed
>> from.
> Here is not so clear what 'joined as usual' mean.
Why not?
> Probably DOC should explicitly say that if LATERAL function return empty set
> then current row is excluded from result set
That would be wrong for "LEFT JOIN LATERAL ...", so it does not seem
like an improvement.
regards, tom lane
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: DOC not so clear
@ 2019-01-15 06:37 Eugen Konkov <kes-kes@yandex.ru>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 4+ messages in thread
From: Eugen Konkov @ 2019-01-15 06:37 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-docs@lists.postgresql.org
Hello Tom,
Monday, January 14, 2019, 6:15:31 PM, you wrote:
> =?utf-8?q?PG_Doc_comments_form?= <noreply@postgresql.org> writes:
>> https://www.postgresql.org/docs/current/queries-table-expressions.html#QUERIES-LATERAL
>>> The resulting row(s) are joined as usual with the rows they were computed
>>> from.
>> Here is not so clear what 'joined as usual' mean.
> Why not?
Advanced users may understand that, but from my beginner point of view
this is not. I do not understand that sentence until read whole text
and about LEFT JOIN LATERAL. Even now 'usual' may mean:
CROSS/RIGHT/FULL??
>> Probably DOC should explicitly say that if LATERAL function return empty set
>> then current row is excluded from result set
> That would be wrong for "LEFT JOIN LATERAL ...", so it does not seem
> like an improvement.
LATERAL != LEFT JOIN LATERAL
it would be more clear if DOC will be more explicit.
> regards, tom lane
--
Best regards,
Eugen Konkov
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: DOC not so clear
@ 2019-01-15 07:14 David G. Johnston <david.g.johnston@gmail.com>
parent: Eugen Konkov <kes-kes@yandex.ru>
0 siblings, 0 replies; 4+ messages in thread
From: David G. Johnston @ 2019-01-15 07:14 UTC (permalink / raw)
To: Eugen Konkov <kes-kes@yandex.ru>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-docs@lists.postgresql.org <pgsql-docs@lists.postgresql.org>
On Monday, January 14, 2019, Eugen Konkov <kes-kes@yandex.ru> wrote:
> Hello Tom,
>
> Monday, January 14, 2019, 6:15:31 PM, you wrote:
>
> > =?utf-8?q?PG_Doc_comments_form?= <noreply@postgresql.org> writes:
> >> https://www.postgresql.org/docs/current/queries-table-
> expressions.html#QUERIES-LATERAL
>
> >>> The resulting row(s) are joined as usual with the rows they were
> computed
> >>> from.
>
> >> Here is not so clear what 'joined as usual' mean.
>
> > Why not?
>
> Advanced users may understand that, but from my beginner point of view
> this is not. I do not understand that sentence until read whole text
> and about LEFT JOIN LATERAL. Even now 'usual' may mean:
> CROSS/RIGHT/FULL?
>
“FROM from_item1, from_item2” has previously been defined to be a cross
join - now with lateral specific from_item2 row(s) are generated using a
single row of from_item1 and cross joined only to that row and no others.
Iteratively.
Left/right/full all require an on/using clause which is pointless for
lateral as the injection of columns from the other row forms an explicit
join link.
>
> >> Probably DOC should explicitly say that if LATERAL function return
> empty set
> >> then current row is excluded from result set
>
> > That would be wrong for "LEFT JOIN LATERAL ...", so it does not seem
> > like an improvement.
>
> LATERAL != LEFT JOIN LATERAL
> it would be more clear if DOC will be more explicit.
>
>
It does:
“It is often particularly handy to LEFT JOIN to a LATERAL subquery, so that
source rows will appear in the result even if the LATERAL subquery produces
no rows for them.”
There may be room for improvement here but it’s non-obvious what exactly it
would look like. It isn’t wrong nor particularly problematic given the
lack of questions seen about lateral on these lists. You are welcome to
supply a patch for consideration though.
David J.
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2019-01-15 07:14 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-01-14 14:42 DOC not so clear PG Doc comments form <noreply@postgresql.org>
2019-01-14 16:15 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-01-15 06:37 ` Eugen Konkov <kes-kes@yandex.ru>
2019-01-15 07:14 ` David G. Johnston <david.g.johnston@gmail.com>
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