Re: [GENERAL] postgresql how to duplicate rows in result. - Mailing list pgsql-general

From David G. Johnston
Subject Re: [GENERAL] postgresql how to duplicate rows in result.
Date
Msg-id CAKFQuwbe3iRwLm-gWmWxzvzh5s4QkYGmD_3yH051vi7VJx5DaQ@mail.gmail.com
Whole thread Raw
In response to Re: [GENERAL] postgresql how to duplicate rows in result.  (Steve Crawford <scrawford@pinpointresearch.com>)
Responses Re: [GENERAL] postgresql how to duplicate rows in result.  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-general
On Thu, Feb 16, 2017 at 9:16 AM, Steve Crawford <scrawford@pinpointresearch.com> wrote:
For my enlightenment, why use LATERAL here? I get the same result with a simple CROSS JOIN (though overall I like the clever solution).


​To be explicit, I think.  CROSS JOIN function() implies lateral in the implementation but you can always specify it if desired.  Like saying LEFT OUTER JOIN instead of LEFT JOIN

If it wasn't lateral the reference to number in "generate_series(1, number)" would fail.

David J.

pgsql-general by date:

Previous
From: Steve Crawford
Date:
Subject: Re: [GENERAL] postgresql how to duplicate rows in result.
Next
From: Tim Bellis
Date:
Subject: Re: [GENERAL] Autovacuum stuck for hours, blocking queries