Re: GROUP BY checks inadequate when set returning functions in column list

Поиск
Список
Период
Сортировка
От Chris Travers
Тема Re: GROUP BY checks inadequate when set returning functions in column list
Дата
Msg-id CAPKNUtcxGUpjRmbm6rQiEa91Kmvsk2T54S3nWeosUe7HDkg6Pw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: GROUP BY checks inadequate when set returning functions in column list  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: GROUP BY checks inadequate when set returning functions in column list
Список pgsql-bugs
On Wed, Aug 22, 2012 at 8:04 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Chris Travers <chris@metatrontech.com> writes:
>> It's when we add group by that things appear broken.  Note it starts
>> returning 196 (14 x 14) records, which suggests a cross join against
>> itself.
>
>> mtech_test=# explain analyze select (account_heading__list()).* group by accno
>> mtech_test-# ;
>
> Hm, that really ought to throw an error, since you have ungrouped
> columns in the result.  Not sure why it doesn't.

Yeah, that was my point.  I don't know if it is worth fixing but
always better to report.
>
> Beyond that, though, using a SRF in the target list this way is a bad
> idea because the semantics are very ill-defined.

Yeah.  It looks like when you pair it with a general set in a from
clause you get an implicit cross join.

I have been avoiding it because I don't like implicit cross joins.

I will be following the LATERAL feature with interest.   Thanks for that.

Best Wishes,
Chris Travers

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: GROUP BY checks inadequate when set returning functions in column list
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: additional message to the bug #7499