Re: Using relations in the SELECT part - Mailing list pgsql-general

From Giuseppe Sacco
Subject Re: Using relations in the SELECT part
Date
Msg-id 1490858720.3316.5.camel@eppesuigoccas.homedns.org
Whole thread Raw
List pgsql-general
Hello Tom,

Il giorno mer, 29/03/2017 alle 09.59 -0400, Tom Lane ha scritto:
[...]
> > Furthermore, let's assume postgres does a cartesian product, if I
> > add a
> > new relation as third element, does it create 4x3 product?
>
> You've hit on the reason why it's semantically ugly: it's not very
> clear what to do with multiple SRFs in one targetlist.  LATERAL,
> together with the ROWS FROM construct, allows clear specification
> of both of the useful behaviors (cartesian product and eval-set-
> returning-functions-in-lockstep).  The multiple-SRFs-in-targetlist
> behavior that we inherited from Berkeley is just a mess, as it
> effectively runs the SRFs until reaching the least common multiple of
> their periods.  We're changing that for v10 though.  You might find
> this commit informative (at least the commit message and
> documentation
> changes):
>
> https://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=69f4b9c85

Thanks for the detailed answer. I'll better study LATERAL joins and
change my query.

BTW, the commit you pointed out has been very very instructive for me.

Thank you,
Giuseppe



pgsql-general by date:

Previous
From: "Agarwal, Prateek"
Date:
Subject: Re: Issue in autovacuum
Next
From: Kyotaro HORIGUCHI
Date:
Subject: Re: Unexpected interval comparison