Re: Syntax bug? Group by?

From: Markus Schaber <schabi(at)logix-tt(dot)com>
To: Mark Woodward <pgsql(at)mohawksoft(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Syntax bug? Group by?
Date: 2006-10-20 11:58:08
Message-ID: 4538B9D0.2050402@logix-tt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2006-10-20 12:05:12 Re: Statements with syntax errors are not logged
Previous Message Andreas Pflug 2006-10-20 09:50:01 Re: adminpack and pg_catalog