Re: searching bison guru - grouping sets implementation

From: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
To: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
Cc: "Pg Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: searching bison guru - grouping sets implementation
Date: 2008-08-05 12:46:30
Message-ID: 48984BA6.4060807@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Pavel Stehule wrote:
> I trying to implement GROUPING SETS feature. But there is basic
> difference between PostgreSQL and ANSI. Pg allows expressions, ANSI
> only column reference.

The conflict seems to arise from the parenthesis, between these two rules:

ordinary_grouping_set:
grouping_column_ref
{
}
*** | '(' grouping_ref_list ')'
{
}
;

and

grouping_column_ref:
a_expr
{}
;

where a_expr can be something like "(foobar)" as well, enclosed in
parenthesis. The grammar is ambiguous for something like
"SELECT ... GROUP BY (foobar)", bison doesn't know if that should be
interpreted as an "'(' grouping_ref_list ')'", whatever that is, or an
a_expr.

I don't know how that should be resolved, or if it's a genuine ambiguity
in the ANSI and PostgreSQL syntax or something that can be fixed with
some Bison magic.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dimitri Fontaine 2008-08-05 12:47:18 Re: Automatic Client Failover
Previous Message Pavel Stehule 2008-08-05 12:19:27 searching bison guru - grouping sets implementation