Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
c530fbfb
Commit
c530fbfb
authored
27 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
Add checks for UNION target fields, and add optional TABLE to LOCK
and SELECT manual pages and psql help.
parent
94abcc16
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/backend/parser/parse_clause.c
+17
-2
17 additions, 2 deletions
src/backend/parser/parse_clause.c
src/bin/psql/psqlHelp.h
+3
-3
3 additions, 3 deletions
src/bin/psql/psqlHelp.h
src/man/lock.l
+3
-3
3 additions, 3 deletions
src/man/lock.l
src/man/select.l
+2
-2
2 additions, 2 deletions
src/man/select.l
with
25 additions
and
10 deletions
src/backend/parser/parse_clause.c
+
17
−
2
View file @
c530fbfb
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.1
3
1998/0
2/26 04:33:29
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.1
4
1998/0
3/18 15:47:51
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -382,11 +382,26 @@ transformUnionClause(List *unionClause, List *targetlist)
...
@@ -382,11 +382,26 @@ transformUnionClause(List *unionClause, List *targetlist)
if
(
unionClause
)
if
(
unionClause
)
{
{
/* recursion */
qlist
=
parse_analyze
(
unionClause
,
NULL
);
qlist
=
parse_analyze
(
unionClause
,
NULL
);
for
(
i
=
0
;
i
<
qlist
->
len
;
i
++
)
for
(
i
=
0
;
i
<
qlist
->
len
;
i
++
)
{
List
*
prev_target
=
targetlist
;
List
*
next_target
;
if
(
length
(
targetlist
)
!=
length
(
qlist
->
qtrees
[
i
]
->
targetList
))
elog
(
ERROR
,
"Each UNION query must have the same number of columns."
);
foreach
(
next_target
,
qlist
->
qtrees
[
i
]
->
targetList
)
{
if
(((
TargetEntry
*
)
lfirst
(
prev_target
))
->
resdom
->
restype
!=
((
TargetEntry
*
)
lfirst
(
next_target
))
->
resdom
->
restype
)
elog
(
ERROR
,
"Each UNION query must have identical target types."
);
prev_target
=
lnext
(
prev_target
);
}
union_list
=
lappend
(
union_list
,
qlist
->
qtrees
[
i
]);
union_list
=
lappend
(
union_list
,
qlist
->
qtrees
[
i
]);
/* we need to check return types are consistent here */
}
return
union_list
;
return
union_list
;
}
}
else
else
...
...
This diff is collapsed.
Click to expand it.
src/bin/psql/psqlHelp.h
+
3
−
3
View file @
c530fbfb
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: psqlHelp.h,v 1.4
0
1998/0
2/03 19:27:00
momjian Exp $
* $Id: psqlHelp.h,v 1.4
1
1998/0
3/18 15:48:26
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -252,7 +252,7 @@ static struct _helpStruct QL_HELP[] = {
...
@@ -252,7 +252,7 @@ static struct _helpStruct QL_HELP[] = {
"load <filename>;"
},
"load <filename>;"
},
{
"lock"
,
{
"lock"
,
"exclusive lock a table inside a transaction"
,
"exclusive lock a table inside a transaction"
,
"lock <class_name>;"
},
"lock
[table]
<class_name>;"
},
{
"move"
,
{
"move"
,
"move an cursor position"
,
"move an cursor position"
,
"move [forward|backward] [<number>|all] [in <cursorname>];"
},
"move [forward|backward] [<number>|all] [in <cursorname>];"
},
...
@@ -273,7 +273,7 @@ static struct _helpStruct QL_HELP[] = {
...
@@ -273,7 +273,7 @@ static struct _helpStruct QL_HELP[] = {
{
"select"
,
{
"select"
,
"retrieve tuples"
,
"retrieve tuples"
,
"select [distinct on <attr>] <expr1> [as <attr1>], ... <exprN> [as <attrN>]
\n
\
"select [distinct on <attr>] <expr1> [as <attr1>], ... <exprN> [as <attrN>]
\n
\
\t
[into table <class_name>]
\n
\
\t
[into
[
table
]
<class_name>]
\n
\
\t
[from <from_list>]
\n
\
\t
[from <from_list>]
\n
\
\t
[where <qual>]
\n
\
\t
[where <qual>]
\n
\
\t
[group by <group_list>]
\n
\
\t
[group by <group_list>]
\n
\
...
...
This diff is collapsed.
Click to expand it.
src/man/lock.l
+
3
−
3
View file @
c530fbfb
.\" This is -*-nroff-*-
.\" This is -*-nroff-*-
.\" XXX standard disclaimer belongs here....
.\" XXX standard disclaimer belongs here....
.\" $Header: /cvsroot/pgsql/src/man/Attic/lock.l,v 1.
3
1998/0
1/28 20:44:42
momjian Exp $
.\" $Header: /cvsroot/pgsql/src/man/Attic/lock.l,v 1.
4
1998/0
3/18 15:48:57
momjian Exp $
.TH FETCH SQL 01/23/93 PostgreSQL PostgreSQL
.TH FETCH SQL 01/23/93 PostgreSQL PostgreSQL
.SH NAME
.SH NAME
lock - exclusive lock a table
lock - exclusive lock a table
.SH SYNOPSIS
.SH SYNOPSIS
.nf
.nf
\fBlock\fR classname
\fBlock\fR
[\fBtable\fR]
classname
.fi
.fi
.SH DESCRIPTION
.SH DESCRIPTION
.BR lock
.BR lock
...
@@ -31,7 +31,7 @@ aquisitions and requests to not form a deadlock.
...
@@ -31,7 +31,7 @@ aquisitions and requests to not form a deadlock.
-- Proper locking to prevent deadlock
-- Proper locking to prevent deadlock
--
--
begin work;
begin work;
lock mytable;
lock
table
mytable;
select * from mytable;
select * from mytable;
update mytable set (x = 100);
update mytable set (x = 100);
end work;
end work;
...
...
This diff is collapsed.
Click to expand it.
src/man/select.l
+
2
−
2
View file @
c530fbfb
.\" This is -*-nroff-*-
.\" This is -*-nroff-*-
.\" XXX standard disclaimer belongs here....
.\" XXX standard disclaimer belongs here....
.\" $Header: /cvsroot/pgsql/src/man/Attic/select.l,v 1.
4
1998/0
1
/1
1 22:17:5
8 momjian Exp $
.\" $Header: /cvsroot/pgsql/src/man/Attic/select.l,v 1.
5
1998/0
3
/1
8 15:49:0
8 momjian Exp $
.TH SELECT SQL 11/05/95 PostgreSQL PostgreSQL
.TH SELECT SQL 11/05/95 PostgreSQL PostgreSQL
.SH NAME
.SH NAME
select - retrieve instances from a class
select - retrieve instances from a class
...
@@ -9,7 +9,7 @@ select - retrieve instances from a class
...
@@ -9,7 +9,7 @@ select - retrieve instances from a class
\fBselect\fR [distinct]
\fBselect\fR [distinct]
expression1 [\fBas\fR attr_name-1]
expression1 [\fBas\fR attr_name-1]
{, expression-1 [\fBas\fR attr_name-i]}
{, expression-1 [\fBas\fR attr_name-i]}
[\fBinto\fR \fBtable\fR classname]
[\fBinto\fR
[
\fBtable\fR
]
classname]
[\fBfrom\fR from-list]
[\fBfrom\fR from-list]
[\fBwhere\fR where-clause]
[\fBwhere\fR where-clause]
[\fBgroup by\fR attr_name1 {, attr_name-i....}]
[\fBgroup by\fR attr_name1 {, attr_name-i....}]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment