Using non-grouping-keys at HAVING clause - Mailing list pgsql-hackers

From Kohei KaiGai
Subject Using non-grouping-keys at HAVING clause
Date
Msg-id CAOP8fzbzmDRZj4zHb_nCGCW6YM6RhemHgwnwAK4KFPh8LXpR7g@mail.gmail.com
Whole thread Raw
Responses Re: Using non-grouping-keys at HAVING clause
List pgsql-hackers
Hello,

I got a trouble report here:
https://github.com/heterodb/pg-strom/issues/636

It says that PG-Strom raised an error when the HAVING clause used
non-grouping-keys,
even though the vanilla PostgreSQL successfully processed the query.

SELECT MAX(c0) FROM t0 GROUP BY t0.c1 HAVING t0.c0<MIN(t0.c0);

However, I'm not certain what is the right behavior here.
The "c0" column does not appear in the GROUP BY clause, thus we cannot
know its individual
values after the group-by stage, right?
So, what does the "HAVING t0.c0<MIN(t0.c0)" evaluate here?

Best regards,
-- 
HeteroDB, Inc / The PG-Strom Project
KaiGai Kohei <kaigai@heterodb.com>



pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Re: Oversight in reparameterize_path_by_child leading to executor crash
Next
From: Dilip Kumar
Date:
Subject: Re: CHECK Constraint Deferrable