mirror of
https://github.com/postgres/postgres.git
synced 2025-06-30 21:42:05 +03:00
Fixes:
While a normal SELECT statement can contain a GROUP BY clause, a cursor declaration cannot. This was not the case in PG-1.0. Was there a good reason why this was changed? Are cursors being phased out? Is there any way to get data with just a SELECT (and without a DECLARE CURSOR ...)? The patch below seems to fix things. If anyone can see a problem with it, please let me know. Thanks. Submitted by: David Smith <dasmith@perseus.tufts.edu>
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.3 1996/07/20 07:58:04 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.4 1996/08/06 16:27:56 scrappy Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -509,6 +509,10 @@ transformCursorStmt(ParseState *pstate, CursorStmt *stmt)
|
||||
qry->sortClause = transformSortClause(stmt->orderClause,
|
||||
qry->targetList,
|
||||
qry->uniqueFlag);
|
||||
/* fix group by clause */
|
||||
qry->groupClause = transformGroupClause(pstate,
|
||||
stmt->groupClause);
|
||||
|
||||
qry->rtable = pstate->p_rtable;
|
||||
|
||||
if (pstate->p_numAgg > 0)
|
||||
|
Reference in New Issue
Block a user