Hi, Mark, Mark Woodward wrote:
>>> My question, is it a syntactic technicality that PostgreSQL asks for a >>> "group by," or a bug in the parser? >> I think that it's a lack of special-casing the = operator. Imagine >> "where ycis_id>15" or "where ycis_id @|< $RECTANGLE" or other (probably >> user defined) operators on (probably user defined) datatypes. >> >> The parser has no real knowledge what the operators do, it simply >> requests one that returns a bool. >> >> One could make the parser to special case the = operator, and maybe some >> others, however I doubt it's worth the effort. > > I understand the SQL, and this isn't a "sql" question else it would be on > a different list, it is a PostgreSQL internals question and IMHO potential > bug. And that's why I talked about PostgreSQL internals. > The original query: > select ycis_id, min(tindex), avg(tindex) from y where ycis_id = 15; > > Should NOT require a "group by" to get ycis_id in the results. And, as I wrote, this is only possible when the query parser special-cases the = operator (compared to all other operators). HTH, Markus -- Markus Schaber | Logical Tracking&Tracing International AG Dipl. Inf. | Software Development GIS Fight against software patents in Europe! www.ffii.org www.nosoftwarepatents.org
signature.asc
Description: OpenPGP digital signature