Re: Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)

From: Andres Freund <andres(at)anarazel(dot)de>
To: Kevin Grittner <kgrittn(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)
Date: 2016-09-02 14:20:23
Message-ID: 20160902142023.ktgvv4ksnqinqr74@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2016-09-02 07:11:10 -0700, Andres Freund wrote:
> On 2016-09-02 09:05:35 -0500, Kevin Grittner wrote:
> > On Fri, Sep 2, 2016 at 3:31 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> > > On Tue, Aug 23, 2016 at 3:10 AM, Andres Freund <andres(at)anarazel(dot)de> wrote:
> >
> > >> =# SELECT * FROM few, ROWS FROM(generate_series(1,3));
> > >> ┌────┬─────────────────┐
> > >> │ id │ generate_series │
> > >> ├────┼─────────────────┤
> > >> │ 1 │ 1 │
> > >> │ 2 │ 1 │
> > >> │ 1 │ 2 │
> > >> │ 2 │ 2 │
> > >> │ 1 │ 3 │
> > >> │ 2 │ 3 │
> > >> └────┴─────────────────┘
> > >> (6 rows)
> > >> surely isn't what was intended. So the join order needs to be enforced.
> > >
> > > In general, we've been skeptical about giving any guarantees about
> > > result ordering.
>
> Well, it's historically how we behaved for SRFs. I'm pretty sure that
> people will be confused if
> SELECT generate_series(1, 10) FROM sometbl;
> suddenly returns rows in an order that reverse from what
> generate_series() returns.

Oh, and we've previously re-added that based on
complaints. C.f. d543170f2fdd6d9845aaf91dc0f6be7a2bf0d9e7 (and others
IIRC).

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-09-02 14:20:42 Re: Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)
Previous Message Kevin Grittner 2016-09-02 14:18:38 Re: Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)