pg-mem
pg-mem copied to clipboard
Order by an ungrouped column doesn't throw an error when it should
Describe the bug
If I sort by a column which isn't in my group by clause, Pg-mem allows it (although doesn't sort correctly) Postgres throws an error, which is what Pg-Mem should do.
To Reproduce
This fails on postgres but wrongly appears to work on pg-mem
postgres=# create table foo (x integer, y integer, z integer);
CREATE TABLE
postgres=# select x, count(distinct y) from foo order by z;
ERROR: column "foo.x" must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: select x, count(distinct y) from foo order by z;
^
postgres=#
pg-mem version
2.9.1 (and sandbox at time of writing)