Tuesday, August 5, 2008

Re: [HACKERS] searching bison guru - grouping sets implementation

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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

No comments: