"David G. Johnston" writes:
> From observation PostgreSQL doesn't recognize the equivalency of the
> outer "group by substring(fileid from -1)" and the subquery expression.
Well, it would without the subselect in between. There's a code comment
in parse_agg.c about this:
* NOTE: we recognize g
On Thu, May 26, 2016 at 12:02 PM, Alex Ignatov
wrote:
> Hello!
>
> Why the following query:
>
> SELECT (select msc_id
> from collectors
> where id = substring(fileid from -1)
>) msc_id
>from ip_data_records
>group by substring(fileid from -1)
>
Hello!
Why the following query:
SELECT (select msc_id
from collectors
where id = substring(fileid from -1)
) msc_id
from ip_data_records
group by substring(fileid from -1)
gives me:
ERROR: subquery uses ungrouped column "ip_data_records.fileid"