public inbox for [email protected]  
help / color / mirror / Atom feed
documentation for WITH RECURSIVE
5+ messages / 2 participants
[nested] [flat]

* documentation for WITH RECURSIVE
@ 2019-11-18 14:36 Andreas Kretschmer <[email protected]>
  2019-11-18 17:32 ` Re: documentation for WITH RECURSIVE Tom Lane <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Andreas Kretschmer @ 2019-11-18 14:36 UTC (permalink / raw)
  To: [email protected]

Hi,

One of our customers had problems with the syntax of WITH RECURSIVE. He 
suggested that the documentation should be improved, maybe with this 
sentence:

"If any of the CTEs is recursive, the recursive keywork must be present 
after with", so to make sure that it does not refer to just one of the 
named subqueries.



Regards, Andreas

-- 
2ndQuadrant - The PostgreSQL Support Company.
www.2ndQuadrant.com






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

* Re: documentation for WITH RECURSIVE
  2019-11-18 14:36 documentation for WITH RECURSIVE Andreas Kretschmer <[email protected]>
@ 2019-11-18 17:32 ` Tom Lane <[email protected]>
  2019-11-18 19:12   ` Re: documentation for WITH RECURSIVE Andreas Kretschmer <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Tom Lane @ 2019-11-18 17:32 UTC (permalink / raw)
  To: Andreas Kretschmer <[email protected]>; +Cc: [email protected]

Andreas Kretschmer <[email protected]> writes:
> One of our customers had problems with the syntax of WITH RECURSIVE. He 
> suggested that the documentation should be improved, maybe with this 
> sentence:
> "If any of the CTEs is recursive, the recursive keywork must be present 
> after with", so to make sure that it does not refer to just one of the 
> named subqueries.

Hm, was this intended for the SELECT man page (presumably in the
"WITH Clause" section), or for section 7.8?

In the SELECT page, I'd be inclined to put it after the para about
"queries need not be ordered" and phrase it more like

  If there are multiple queries in the WITH clause, RECURSIVE can
  be written only once, immediately after WITH.  It applies to all
  queries in the WITH clause (but has no effect on queries that do
  not use either of these features).

			regards, tom lane





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

* Re: documentation for WITH RECURSIVE
  2019-11-18 14:36 documentation for WITH RECURSIVE Andreas Kretschmer <[email protected]>
  2019-11-18 17:32 ` Re: documentation for WITH RECURSIVE Tom Lane <[email protected]>
@ 2019-11-18 19:12   ` Andreas Kretschmer <[email protected]>
  2019-11-19 12:29     ` Re: documentation for WITH RECURSIVE Andreas Kretschmer <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Andreas Kretschmer @ 2019-11-18 19:12 UTC (permalink / raw)
  To: Tom Lane <[email protected]>; +Cc: [email protected]



Am 18.11.19 um 18:32 schrieb Tom Lane:
> Andreas Kretschmer <[email protected]> writes:
>> One of our customers had problems with the syntax of WITH RECURSIVE. He
>> suggested that the documentation should be improved, maybe with this
>> sentence:
>> "If any of the CTEs is recursive, the recursive keywork must be present
>> after with", so to make sure that it does not refer to just one of the
>> named subqueries.
> Hm, was this intended for the SELECT man page (presumably in the
> "WITH Clause" section), or for section 7.8?
>
> In the SELECT page, I'd be inclined to put it after the para about
> "queries need not be ordered" and phrase it more like
>
>    If there are multiple queries in the WITH clause, RECURSIVE can
>    be written only once, immediately after WITH.  It applies to all
>    queries in the WITH clause (but has no effect on queries that do
>    not use either of these features).
>
> 			regards, tom lane

yeah, sounds good to me, thx Tom.

Regards, Andreas

-- 
2ndQuadrant - The PostgreSQL Support Company.
www.2ndQuadrant.com






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

* Re: documentation for WITH RECURSIVE
  2019-11-18 14:36 documentation for WITH RECURSIVE Andreas Kretschmer <[email protected]>
  2019-11-18 17:32 ` Re: documentation for WITH RECURSIVE Tom Lane <[email protected]>
  2019-11-18 19:12   ` Re: documentation for WITH RECURSIVE Andreas Kretschmer <[email protected]>
@ 2019-11-19 12:29     ` Andreas Kretschmer <[email protected]>
  2019-11-19 19:47       ` Re: documentation for WITH RECURSIVE Tom Lane <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Andreas Kretschmer @ 2019-11-19 12:29 UTC (permalink / raw)
  To: [email protected]



Am 18.11.19 um 20:12 schrieb Andreas Kretschmer:
>
>
> Am 18.11.19 um 18:32 schrieb Tom Lane:
>> Andreas Kretschmer <[email protected]> writes:
>>> One of our customers had problems with the syntax of WITH RECURSIVE. He
>>> suggested that the documentation should be improved, maybe with this
>>> sentence:
>>> "If any of the CTEs is recursive, the recursive keywork must be present
>>> after with", so to make sure that it does not refer to just one of the
>>> named subqueries.
>> Hm, was this intended for the SELECT man page (presumably in the
>> "WITH Clause" section), or for section 7.8?
>>
>

Hi Tom,

it would be good if we can also add this to chapter 7.8, wouldn't it?


Regards, Andreas

-- 
2ndQuadrant - The PostgreSQL Support Company.
www.2ndQuadrant.com






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

* Re: documentation for WITH RECURSIVE
  2019-11-18 14:36 documentation for WITH RECURSIVE Andreas Kretschmer <[email protected]>
  2019-11-18 17:32 ` Re: documentation for WITH RECURSIVE Tom Lane <[email protected]>
  2019-11-18 19:12   ` Re: documentation for WITH RECURSIVE Andreas Kretschmer <[email protected]>
  2019-11-19 12:29     ` Re: documentation for WITH RECURSIVE Andreas Kretschmer <[email protected]>
@ 2019-11-19 19:47       ` Tom Lane <[email protected]>
  0 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2019-11-19 19:47 UTC (permalink / raw)
  To: Andreas Kretschmer <[email protected]>; +Cc: [email protected]

Andreas Kretschmer <[email protected]> writes:
> it would be good if we can also add this to chapter 7.8, wouldn't it?

I don't feel a need to.  7.8 isn't attempting to define the syntax
precisely.  Moreover, we've had this feature since 8.4, and this
is the first I've heard of somebody misinterpreting the syntax;
so it doesn't seem like it's a huge problem that requires multiple
explanations.

I've pushed a patch for the SELECT reference page.

			regards, tom lane






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


end of thread, other threads:[~2019-11-19 19:47 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-11-18 14:36 documentation for WITH RECURSIVE Andreas Kretschmer <[email protected]>
2019-11-18 17:32 ` Tom Lane <[email protected]>
2019-11-18 19:12   ` Andreas Kretschmer <[email protected]>
2019-11-19 12:29     ` Andreas Kretschmer <[email protected]>
2019-11-19 19:47       ` Tom Lane <[email protected]>

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