Sender: owner-postgres95@postgres.Berkeley.EDU
X-Return-Path: andrew_yu
Received: from eden.CS.Berkeley.EDU (eden.CS.Berkeley.EDU [128.32.37.56]) by nobozo.CS.Berkeley.EDU (8.6.10/8.6.3) with ESMTP id WAA27425 for <postgres95@postgres.Berkeley.EDU>; Mon, 6 Nov 1995 22:37:56 -0800
Received: (andrew@localhost) by eden.CS.Berkeley.EDU (8.6.10/8.6.3) id WAA16808; Mon, 6 Nov 1995 22:37:52 -0800
Date: Mon, 6 Nov 1995 22:37:52 -0800
From: "Andrew K. Yu" <andrew@postgres.Berkeley.EDU>
Message-Id: <199511070637.WAA16808@eden.CS.Berkeley.EDU>
To: jamiec@interport.net, postgres95@postgres.Berkeley.EDU
Subject: Re:  Is there a reason that DECLARE .. GROUP BY was not implemented
Resent-To: postgres95-redist
Resent-Date: Mon, 06 Nov 95 22:37:56 -0800
Resent-From: pglite
Resent-XMts: smtp


> Was there a reason that the followin statement " DECLARE mycursor cursor for 
> select sum(a) from test group by a;" was not implemented.  I have 

there is no inherent reason other than not enough time. (I don't know how many
people noticed but if you ever look at the postgres 4.2 code, you'll see tons
of LispValue in the parser which makes doing something simple like what jamie
did in the following impossible to do. And converting postgres' internals to
use the new data structures took up a significant amount of time.)

> modified 'gram.y' to allow for 'group_clause' and n->groupClause in the 
> CursorStmt structure and modified 'nodes/parsernodes.h' to have a 
> LList * groupClause.  What else should I modify to get this functionality.

you also need to modify transformCursorStmt in parser/analyze.c (add
a transformGroupBy call like what transformSelect did.)

-andrew

===============================================================================
  To unsubscribe from the Postgres95 mailing list, send mail with the subject
  line "DEL" to "postgres95-request@postgres.Berkeley.EDU". 
============  URL: http://s2k-ftp.CS.Berkeley.EDU:8000/postgres95/  ===========
