aboutsummaryrefslogtreecommitdiff
path: root/src/include/nodes/parsenodes.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>1999-12-10 07:37:35 +0000
committerTom Lane <tgl@sss.pgh.pa.us>1999-12-10 07:37:35 +0000
commit18c30002863a1a4d2c2f0da6d245f106586bc686 (patch)
treeb417e01845965594239b0f8944e1baf00688b12e /src/include/nodes/parsenodes.h
parentecba5d308ca92d3a4fd0725c200452007217991b (diff)
downloadpostgresql-18c30002863a1a4d2c2f0da6d245f106586bc686.tar.gz
postgresql-18c30002863a1a4d2c2f0da6d245f106586bc686.zip
Teach grammar and parser about aggregate(DISTINCT ...). No implementation
yet, but at least we can give a better error message: regression=> select count(distinct f1) from int4_tbl; ERROR: aggregate(DISTINCT ...) is not implemented yet instead of 'parser: parse error at or near distinct'.
Diffstat (limited to 'src/include/nodes/parsenodes.h')
-rw-r--r--src/include/nodes/parsenodes.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h
index bcff7aa3006..df0cb5c4e54 100644
--- a/src/include/nodes/parsenodes.h
+++ b/src/include/nodes/parsenodes.h
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: parsenodes.h,v 1.89 1999/12/10 03:56:09 momjian Exp $
+ * $Id: parsenodes.h,v 1.90 1999/12/10 07:37:32 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -758,6 +758,10 @@ typedef struct SelectStmt
/****************************************************************************
* Supporting data structures for Parse Trees
+ *
+ * Most of these node types appear in raw parsetrees output by the grammar,
+ * and get transformed to something else by the analyzer. A few of them
+ * are used as-is in transformed querytrees.
****************************************************************************/
/*
@@ -889,13 +893,20 @@ typedef struct Ident
} Ident;
/*
- * FuncCall - a function/aggregate invocation
+ * FuncCall - a function or aggregate invocation
+ *
+ * agg_star indicates we saw a 'foo(*)' construct, while agg_distinct
+ * indicates we saw 'foo(DISTINCT ...)'. In either case, the construct
+ * *must* be an aggregate call. Otherwise, it might be either an
+ * aggregate or some other kind of function.
*/
typedef struct FuncCall
{
NodeTag type;
char *funcname; /* name of function */
List *args; /* the arguments (list of exprs) */
+ bool agg_star; /* argument was really '*' */
+ bool agg_distinct; /* arguments were labeled DISTINCT */
} FuncCall;
/*