suggestion for diagnostics (errors) - Mailing list pgsql-general

From Nikolay Samokhvalov
Subject suggestion for diagnostics (errors)
Date
Msg-id e431ff4c05070606142e46faf6@mail.gmail.com
Whole thread Raw
List pgsql-general
Consider following SQL:
**
select femail, min(fid) AS main_id, count(fid) AS countids
from users
where count(fid) > 1
group by femail
**

Of course, postgreSQL produce error for such wrong statement:

SQL error:

ERROR:  aggregates not allowed in WHERE clause

I think it would be much better if DBMS will provide us some kind of suggestions, e.g.:

SQL error:

ERROR:  aggregates not allowed in WHERE clause. Consider using HAVING clause.




--
Best regards,
Nikolay

pgsql-general by date:

Previous
From: "Sim Zacks"
Date:
Subject: template1 problems
Next
From: Clark Allan
Date:
Subject: Re: PostgreSQL sequence within function