pgsql/src/backend/parser (gram.y)

From: Bruce Momjian - CVS <momjian(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql/src/backend/parser (gram.y)
Date: 2000-10-28 15:44:06
Message-ID: 200010281544.e9SFi6o21146@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Date: Saturday, October 28, 2000 @ 11:44:05
Author: momjian

Update of /home/projects/pgsql/cvsroot/pgsql/src/backend/parser
from hub.org:/home/projects/pgsql/tmp/cvs-serv21056/pgsql/src/backend/parser

Modified Files:
gram.y

----------------------------- Log Message -----------------------------

Okay, here's my attempt at fixing the problems with parentheses in
subqueries. It passes the normal 'runcheck' tests, and I've tried
a few simple things like
select 1 as foo union (((((select 2))))) order by foo;

There are a few things that it doesn't do that have been talked
about here at least a little:

1) It doesn't allow things like "IN(((select 1)))" -- the select
here has to be at the top level. This is not new.
2) It does NOT preserve the odd syntax I found when I started looking
at this, where a SELECT statement could begin with parentheses. Thus,
(SELECT a from foo) order by a;
fails.

I have preserved the ability, used in the regression tests, to
have a single select statement in what appears to be a RuleActionMulti
(but wasn't -- the parens were part of select_clause syntax).
In my version, this is a special form.

This may cause some discussion: I have differentiated the two kinds
of RuleActionMulti. Perhaps nobody knew there were two kinds, because
I don't think the second form appears in the regression tests. This
one uses square brackets instead of parentheses, but originally was
otherwise the same as the one in parentheses. In this version of
gram.y, the square bracket form treats SELECT statements the same
as the other allowed statements. As discussed before on this list,
psql cannot make sense out of the results of such a thing, but an
application might. And I have designs on just such an application.

++ kevin o'gorman

Browse pgsql-committers by date

  From Date Subject
Next Message Vadim B. Mikheev - CVS 2000-10-28 16:20:54 pgsql/src/backend/access/transam (transsup.c varsup.c xact.c xlog.c xlogutils.c)
Previous Message Peter Eisentraut - PostgreSQL 2000-10-28 15:10:37 pgsql/src/interfaces/odbc (GNUmakefile bind.c environ.c options.c)