Skip to content

Commit 01ecb2e

Browse files
committed
documentation for HAVING, clean up UNION comment.
1 parent ef0eecf commit 01ecb2e

File tree

3 files changed

+27
-7
lines changed

3 files changed

+27
-7
lines changed

src/backend/optimizer/prep/prepunion.c

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.20 1998/02/26 04:33:05 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.21 1998/03/30 19:04:41 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -71,7 +71,8 @@ plan_union_queries(Query *parse)
7171
union_found = false,
7272
last_unionall_flag = false;
7373

74-
/*
74+
/*------------------------------------------------------------------
75+
*
7576
* Do we need to split up our unions because we have UNION and UNION
7677
* ALL?
7778
*
@@ -87,10 +88,25 @@ plan_union_queries(Query *parse)
8788
*
8889
* So the above query becomes:
8990
*
90-
* Append Node { Sort and Unique { Append Node { SELECT 1
91-
* This is really a sub-UNION, unionClause We run a
92-
* DISTINCT on these. { SELECT 2 SELECT 3 } } } SELECT 4 SELECT 5 }
91+
* Append Node
92+
* {
93+
* Sort and Unique
94+
* {
95+
* Append Node
96+
* {
97+
* SELECT 1 This is really a sub-UNION.
98+
* unionClause We run a DISTINCT on these.
99+
* {
100+
* SELECT 2
101+
* SELECT 3
102+
* }
103+
* }
104+
* }
105+
* SELECT 4
106+
* SELECT 5
107+
* }
93108
*
109+
*---------------------------------------------------------------------
94110
*/
95111

96112
foreach(ulist, parse->unionClause)

src/bin/psql/psqlHelp.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Copyright (c) 1994, Regents of the University of California
77
*
8-
* $Id: psqlHelp.h,v 1.41 1998/03/18 15:48:26 momjian Exp $
8+
* $Id: psqlHelp.h,v 1.42 1998/03/30 19:04:53 momjian Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -163,6 +163,7 @@ static struct _helpStruct QL_HELP[] = {
163163
\t[from <from_list>]\n\
164164
\t[where <qual>]\n\
165165
\t[group by <group_list>]\n\
166+
\t[having <having_clause>]\n\
166167
\t[order by <attr1> [using <op1>],... <attrN> [using <opN>]]\n\
167168
\t[union [all] select ...];"},
168169
{"delete",
@@ -243,6 +244,7 @@ static struct _helpStruct QL_HELP[] = {
243244
\t[from <from_clause>]\n\
244245
\t[where <qual>]\n\
245246
\t[group by <group_list>]\n\
247+
\t[having <having_clause>]\n\
246248
\t[union [all] select ...];"},
247249
{"listen",
248250
"listen for notification on a relation",
@@ -277,6 +279,7 @@ static struct _helpStruct QL_HELP[] = {
277279
\t[from <from_list>]\n\
278280
\t[where <qual>]\n\
279281
\t[group by <group_list>]\n\
282+
\t[having <having_clause>]\n\
280283
\t[order by <attr1> [ASC | DESC] [using <op1>], ... <attrN> ]\n\
281284
\t[union [all] select ...];"},
282285
{"set",

src/man/select.l

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" This is -*-nroff-*-
22
.\" XXX standard disclaimer belongs here....
3-
.\" $Header: /cvsroot/pgsql/src/man/Attic/select.l,v 1.5 1998/03/18 15:49:08 momjian Exp $
3+
.\" $Header: /cvsroot/pgsql/src/man/Attic/select.l,v 1.6 1998/03/30 19:05:10 momjian Exp $
44
.TH SELECT SQL 11/05/95 PostgreSQL PostgreSQL
55
.SH NAME
66
select - retrieve instances from a class
@@ -13,6 +13,7 @@ select - retrieve instances from a class
1313
[\fBfrom\fR from-list]
1414
[\fBwhere\fR where-clause]
1515
[\fBgroup by\fR attr_name1 {, attr_name-i....}]
16+
[\fBhaving\fR having-clause]
1617
[\fBorder by\fR attr_name1 [\fBasc\fR | \fBdesc\fR] [\fBusing op1\fR] {, attr_namei...}]
1718
[\fBunion {all} select\fR ...]
1819

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy