documentation for HAVING, clean up UNION comment.
authorBruce Momjian <bruce@momjian.us>
Mon, 30 Mar 1998 19:05:10 +0000 (19:05 +0000)
committerBruce Momjian <bruce@momjian.us>
Mon, 30 Mar 1998 19:05:10 +0000 (19:05 +0000)
src/backend/optimizer/prep/prepunion.c
src/bin/psql/psqlHelp.h
src/man/select.l

index 7b36d3b8e8c00682fb3ec9061ab38b1fece0cdde..e821f20a9635f35975115190c0904f2146eed26c 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.20 1998/02/26 04:33:05 momjian Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.21 1998/03/30 19:04:41 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -71,7 +71,8 @@ plan_union_queries(Query *parse)
                union_found = false,
                last_unionall_flag = false;
 
-   /*
+   /*------------------------------------------------------------------
+    *
     * Do we need to split up our unions because we have UNION and UNION
     * ALL?
     *
@@ -87,10 +88,25 @@ plan_union_queries(Query *parse)
     *
     * So the above query becomes:
     *
-    * Append Node { Sort and Unique { Append Node { SELECT 1
-    * This is really a sub-UNION, unionClause             We run a
-    * DISTINCT on these. { SELECT 2 SELECT 3 } } } SELECT 4 SELECT 5 }
+    *  Append Node
+    *  {
+    *      Sort and Unique
+    *      {
+    *          Append Node
+    *          {
+    *              SELECT 1        This is really a sub-UNION.
+    *              unionClause     We run a DISTINCT on these.
+    *              {
+    *                  SELECT 2
+    *                  SELECT 3
+    *              }
+    *          }
+    *      }
+    *      SELECT 4
+    *      SELECT 5
+    *  }
     *
+    *---------------------------------------------------------------------
     */
 
    foreach(ulist, parse->unionClause)
index 9c444f490c74975f89d55eb43eab59f878e5e67c..166e60098002d36261d12f3be1c92f037d849222 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: psqlHelp.h,v 1.41 1998/03/18 15:48:26 momjian Exp $
+ * $Id: psqlHelp.h,v 1.42 1998/03/30 19:04:53 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -163,6 +163,7 @@ static struct _helpStruct QL_HELP[] = {
 \t[from <from_list>]\n\
 \t[where <qual>]\n\
 \t[group by <group_list>]\n\
+\t[having <having_clause>]\n\
 \t[order by <attr1> [using <op1>],... <attrN> [using <opN>]]\n\
 \t[union [all] select ...];"},
    {"delete",
@@ -243,6 +244,7 @@ static struct _helpStruct QL_HELP[] = {
 \t[from <from_clause>]\n\
 \t[where <qual>]\n\
 \t[group by <group_list>]\n\
+\t[having <having_clause>]\n\
 \t[union [all] select ...];"},
    {"listen",
        "listen for notification on a relation",
@@ -277,6 +279,7 @@ static struct _helpStruct QL_HELP[] = {
 \t[from <from_list>]\n\
 \t[where <qual>]\n\
 \t[group by <group_list>]\n\
+\t[having <having_clause>]\n\
 \t[order by <attr1> [ASC | DESC] [using <op1>], ... <attrN> ]\n\
 \t[union [all] select ...];"},
    {"set",
index 739e23c13d0bec04ba5cdd9c02856bec0b455645..7fa3f5607e61c2959ba991e2f4b73a04d08ba9f0 100644 (file)
@@ -1,6 +1,6 @@
 .\" This is -*-nroff-*-
 .\" XXX standard disclaimer belongs here....
-.\" $Header: /cvsroot/pgsql/src/man/Attic/select.l,v 1.5 1998/03/18 15:49:08 momjian Exp $
+.\" $Header: /cvsroot/pgsql/src/man/Attic/select.l,v 1.6 1998/03/30 19:05:10 momjian Exp $
 .TH SELECT SQL 11/05/95 PostgreSQL PostgreSQL
 .SH NAME
 select - retrieve instances from a class
@@ -13,6 +13,7 @@ select - retrieve instances from a class
     [\fBfrom\fR from-list]
     [\fBwhere\fR where-clause]    
     [\fBgroup by\fR attr_name1 {, attr_name-i....}]
+    [\fBhaving\fR having-clause]
     [\fBorder by\fR attr_name1 [\fBasc\fR | \fBdesc\fR] [\fBusing op1\fR] {, attr_namei...}]
 [\fBunion {all} select\fR ...]