File tree Expand file tree Collapse file tree 4 files changed +25
-10
lines changed Expand file tree Collapse file tree 4 files changed +25
-10
lines changed Original file line number Diff line number Diff line change 7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.13 1998/02/26 04:33:29 momjian Exp $
10
+ * $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.14 1998/03/18 15:47:51 momjian Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -382,11 +382,26 @@ transformUnionClause(List *unionClause, List *targetlist)
382
382
383
383
if (unionClause )
384
384
{
385
+ /* recursion */
385
386
qlist = parse_analyze (unionClause , NULL );
386
387
387
388
for (i = 0 ; i < qlist -> len ; i ++ )
389
+ {
390
+ List * prev_target = targetlist ;
391
+ List * next_target ;
392
+
393
+ if (length (targetlist ) != length (qlist -> qtrees [i ]-> targetList ))
394
+ elog (ERROR ,"Each UNION query must have the same number of columns." );
395
+
396
+ foreach (next_target , qlist -> qtrees [i ]-> targetList )
397
+ {
398
+ if (((TargetEntry * )lfirst (prev_target ))-> resdom -> restype !=
399
+ ((TargetEntry * )lfirst (next_target ))-> resdom -> restype )
400
+ elog (ERROR ,"Each UNION query must have identical target types." );
401
+ prev_target = lnext (prev_target );
402
+ }
388
403
union_list = lappend (union_list , qlist -> qtrees [i ]);
389
- /* we need to check return types are consistent here */
404
+ }
390
405
return union_list ;
391
406
}
392
407
else
Original file line number Diff line number Diff line change 5
5
*
6
6
* Copyright (c) 1994, Regents of the University of California
7
7
*
8
- * $Id: psqlHelp.h,v 1.40 1998/02/03 19:27:00 momjian Exp $
8
+ * $Id: psqlHelp.h,v 1.41 1998/03/18 15:48:26 momjian Exp $
9
9
*
10
10
*-------------------------------------------------------------------------
11
11
*/
@@ -252,7 +252,7 @@ static struct _helpStruct QL_HELP[] = {
252
252
"load <filename>;" },
253
253
{"lock" ,
254
254
"exclusive lock a table inside a transaction" ,
255
- "lock <class_name>;" },
255
+ "lock [table] <class_name>;" },
256
256
{"move" ,
257
257
"move an cursor position" ,
258
258
"move [forward|backward] [<number>|all] [in <cursorname>];" },
@@ -273,7 +273,7 @@ static struct _helpStruct QL_HELP[] = {
273
273
{"select" ,
274
274
"retrieve tuples" ,
275
275
"select [distinct on <attr>] <expr1> [as <attr1>], ... <exprN> [as <attrN>]\n\
276
- \t[into table <class_name>]\n\
276
+ \t[into [ table] <class_name>]\n\
277
277
\t[from <from_list>]\n\
278
278
\t[where <qual>]\n\
279
279
\t[group by <group_list>]\n\
Original file line number Diff line number Diff line change 1
1
.\" This is -*-nroff-*-
2
2
.\" XXX standard disclaimer belongs here....
3
- .\" $Header: /cvsroot/pgsql/src/man/Attic/lock.l,v 1.3 1998/01/28 20:44:42 momjian Exp $
3
+ .\" $Header: /cvsroot/pgsql/src/man/Attic/lock.l,v 1.4 1998/03/18 15:48:57 momjian Exp $
4
4
.TH FETCH SQL 01/23/93 PostgreSQL PostgreSQL
5
5
.SH NAME
6
6
lock - exclusive lock a table
7
7
.SH SYNOPSIS
8
8
.nf
9
- \fB lock \fR classname
9
+ \fB lock \fR [ \fB table \fR ] classname
10
10
.fi
11
11
.SH DESCRIPTION
12
12
.BR lock
@@ -31,7 +31,7 @@ aquisitions and requests to not form a deadlock.
31
31
-- Proper locking to prevent deadlock
32
32
--
33
33
begin work;
34
- lock mytable;
34
+ lock table mytable;
35
35
select * from mytable;
36
36
update mytable set (x = 100);
37
37
end work;
Original file line number Diff line number Diff line change 1
1
.\" This is -*-nroff-*-
2
2
.\" XXX standard disclaimer belongs here....
3
- .\" $Header: /cvsroot/pgsql/src/man/Attic/select.l,v 1.4 1998/01/11 22:17:58 momjian Exp $
3
+ .\" $Header: /cvsroot/pgsql/src/man/Attic/select.l,v 1.5 1998/03/18 15:49:08 momjian Exp $
4
4
.TH SELECT SQL 11/05/95 PostgreSQL PostgreSQL
5
5
.SH NAME
6
6
select - retrieve instances from a class
@@ -9,7 +9,7 @@ select - retrieve instances from a class
9
9
\fB select \fR [distinct]
10
10
expression1 [\fB as \fR attr_name-1]
11
11
{, expression-1 [\fB as \fR attr_name-i]}
12
- [\fB into \fR \fB table \fR classname]
12
+ [\fB into \fR [ \fB table \fR ] classname]
13
13
[\fB from \fR from-list]
14
14
[\fB where \fR where-clause]
15
15
[\fB group by \fR attr_name1 {, attr_name-i....}]
You can’t perform that action at this time.
0 commit comments