Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
a576a60e
Commit
a576a60e
authored
Jun 04, 1998
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show backend status on ps command line. Remove unused args from
pg_exec_query().
parent
99d21d5b
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
141 additions
and
92 deletions
+141
-92
src/backend/commands/_deadcode/version.c
src/backend/commands/_deadcode/version.c
+3
-3
src/backend/commands/dbcommands.c
src/backend/commands/dbcommands.c
+3
-3
src/backend/commands/user.c
src/backend/commands/user.c
+5
-5
src/backend/libpq/be-pqexec.c
src/backend/libpq/be-pqexec.c
+2
-2
src/backend/main/main.c
src/backend/main/main.c
+2
-2
src/backend/postmaster/postmaster.c
src/backend/postmaster/postmaster.c
+38
-9
src/backend/rewrite/rewriteDefine.c
src/backend/rewrite/rewriteDefine.c
+2
-2
src/backend/tcop/postgres.c
src/backend/tcop/postgres.c
+31
-11
src/backend/tcop/pquery.c
src/backend/tcop/pquery.c
+4
-5
src/backend/tcop/utility.c
src/backend/tcop/utility.c
+44
-42
src/include/tcop/pquery.h
src/include/tcop/pquery.h
+2
-3
src/include/tcop/tcopprot.h
src/include/tcop/tcopprot.h
+5
-5
No files found.
src/backend/commands/_deadcode/version.c
View file @
a576a60e
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/_deadcode/Attic/version.c,v 1.1
1 1998/01/05 16:39:07
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/_deadcode/Attic/version.c,v 1.1
2 1998/06/04 17:26:38
momjian Exp $
*
*
* NOTES
* NOTES
* At the point the version is defined, 2 physical relations are created
* At the point the version is defined, 2 physical relations are created
...
@@ -95,7 +95,7 @@ eval_as_new_xact(char *query)
...
@@ -95,7 +95,7 @@ eval_as_new_xact(char *query)
* CommitTransactionCommand(); StartTransactionCommand();
* CommitTransactionCommand(); StartTransactionCommand();
*/
*/
CommandCounterIncrement
();
CommandCounterIncrement
();
pg_exec_query
(
query
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
pg_exec_query
(
query
);
}
}
#endif
#endif
...
@@ -157,7 +157,7 @@ VersionCreate(char *vname, char *bname)
...
@@ -157,7 +157,7 @@ VersionCreate(char *vname, char *bname)
sprintf
(
query_buf
,
"SELECT * INTO TABLE %s from %s where 1 =2"
,
sprintf
(
query_buf
,
"SELECT * INTO TABLE %s from %s where 1 =2"
,
vname
,
bname
);
vname
,
bname
);
pg_exec_query
(
query_buf
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
pg_exec_query
(
query_buf
);
/*
/*
* Creating the ``v_added'' relation
* Creating the ``v_added'' relation
...
...
src/backend/commands/dbcommands.c
View file @
a576a60e
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.1
3 1998/04/27 04:05:11
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.1
4 1998/06/04 17:26:38
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -95,7 +95,7 @@ createdb(char *dbname, char *dbpath)
...
@@ -95,7 +95,7 @@ createdb(char *dbname, char *dbpath)
sprintf
(
buf
,
"insert into pg_database (datname, datdba, datpath)"
sprintf
(
buf
,
"insert into pg_database (datname, datdba, datpath)"
" values (
\'
%s
\'
,
\'
%d
\'
,
\'
%s
\'
);"
,
dbname
,
user_id
,
loc
);
" values (
\'
%s
\'
,
\'
%d
\'
,
\'
%s
\'
);"
,
dbname
,
user_id
,
loc
);
pg_exec_query
(
buf
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
pg_exec_query
(
buf
);
}
}
void
void
...
@@ -133,7 +133,7 @@ destroydb(char *dbname)
...
@@ -133,7 +133,7 @@ destroydb(char *dbname)
*/
*/
sprintf
(
buf
,
"delete from pg_database where pg_database.oid =
\'
%d
\'
::oid"
,
sprintf
(
buf
,
"delete from pg_database where pg_database.oid =
\'
%d
\'
::oid"
,
db_id
);
db_id
);
pg_exec_query
(
buf
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
pg_exec_query
(
buf
);
/*
/*
* remove the data directory. If the DELETE above failed, this will
* remove the data directory. If the DELETE above failed, this will
...
...
src/backend/commands/user.c
View file @
a576a60e
...
@@ -65,7 +65,7 @@ UpdatePgPwdFile(char *sql)
...
@@ -65,7 +65,7 @@ UpdatePgPwdFile(char *sql)
* file to its final name.
* file to its final name.
*/
*/
sprintf
(
sql
,
"copy %s to '%s' using delimiters %s"
,
ShadowRelationName
,
tempname
,
CRYPT_PWD_FILE_SEPCHAR
);
sprintf
(
sql
,
"copy %s to '%s' using delimiters %s"
,
ShadowRelationName
,
tempname
,
CRYPT_PWD_FILE_SEPCHAR
);
pg_exec_query
(
sql
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
pg_exec_query
(
sql
);
rename
(
tempname
,
filename
);
rename
(
tempname
,
filename
);
free
((
void
*
)
tempname
);
free
((
void
*
)
tempname
);
...
@@ -196,7 +196,7 @@ DefineUser(CreateUserStmt *stmt)
...
@@ -196,7 +196,7 @@ DefineUser(CreateUserStmt *stmt)
}
}
strcat
(
sql_end
,
")"
);
strcat
(
sql_end
,
")"
);
pg_exec_query
(
sql
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
pg_exec_query
(
sql
);
/*
/*
* Add the stuff here for groups.
* Add the stuff here for groups.
...
@@ -328,7 +328,7 @@ AlterUser(AlterUserStmt *stmt)
...
@@ -328,7 +328,7 @@ AlterUser(AlterUserStmt *stmt)
{
{
sql_end
+=
strlen
(
sql_end
);
sql_end
+=
strlen
(
sql_end
);
sprintf
(
sql_end
,
" where usename = '%s'"
,
stmt
->
user
);
sprintf
(
sql_end
,
" where usename = '%s'"
,
stmt
->
user
);
pg_exec_query
(
sql
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
pg_exec_query
(
sql
);
}
}
/* do the pg_group stuff here */
/* do the pg_group stuff here */
...
@@ -450,7 +450,7 @@ RemoveUser(char *user)
...
@@ -450,7 +450,7 @@ RemoveUser(char *user)
elog
(
NOTICE
,
"Dropping database %s"
,
dbase
[
ndbase
]);
elog
(
NOTICE
,
"Dropping database %s"
,
dbase
[
ndbase
]);
sprintf
(
sql
,
"drop database %s"
,
dbase
[
ndbase
]);
sprintf
(
sql
,
"drop database %s"
,
dbase
[
ndbase
]);
free
((
void
*
)
dbase
[
ndbase
]);
free
((
void
*
)
dbase
[
ndbase
]);
pg_exec_query
(
sql
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
pg_exec_query
(
sql
);
}
}
if
(
dbase
)
if
(
dbase
)
free
((
void
*
)
dbase
);
free
((
void
*
)
dbase
);
...
@@ -477,7 +477,7 @@ RemoveUser(char *user)
...
@@ -477,7 +477,7 @@ RemoveUser(char *user)
* Remove the user from the pg_shadow table
* Remove the user from the pg_shadow table
*/
*/
sprintf
(
sql
,
"delete from %s where usename = '%s'"
,
ShadowRelationName
,
user
);
sprintf
(
sql
,
"delete from %s where usename = '%s'"
,
ShadowRelationName
,
user
);
pg_exec_query
(
sql
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
pg_exec_query
(
sql
);
UpdatePgPwdFile
(
sql
);
UpdatePgPwdFile
(
sql
);
...
...
src/backend/libpq/be-pqexec.c
View file @
a576a60e
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-pqexec.c,v 1.1
5 1998/02/26 04:31:45
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-pqexec.c,v 1.1
6 1998/06/04 17:26:39
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -147,7 +147,7 @@ PQexec(char *query)
...
@@ -147,7 +147,7 @@ PQexec(char *query)
* end up on the top of the portal stack.
* end up on the top of the portal stack.
* ----------------
* ----------------
*/
*/
pg_exec_query_dest
(
query
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
,
Local
);
pg_exec_query_dest
(
query
,
Local
);
/* ----------------
/* ----------------
* pop the portal off the portal stack and return the
* pop the portal off the portal stack and return the
...
...
src/backend/main/main.c
View file @
a576a60e
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/main/main.c,v 1.
19 1998/05/12 21:43:59
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/main/main.c,v 1.
20 1998/06/04 17:26:40
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -102,5 +102,5 @@ main(int argc, char *argv[])
...
@@ -102,5 +102,5 @@ main(int argc, char *argv[])
exit
(
BootstrapMain
(
argc
-
1
,
argv
+
1
));
/* remove the -boot arg
exit
(
BootstrapMain
(
argc
-
1
,
argv
+
1
));
/* remove the -boot arg
* from the command line */
* from the command line */
else
else
exit
(
PostgresMain
(
argc
,
argv
));
exit
(
PostgresMain
(
argc
,
argv
,
argc
,
argv
));
}
}
src/backend/postmaster/postmaster.c
View file @
a576a60e
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.
79 1998/05/29 17:10:07
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.
80 1998/06/04 17:26:41
momjian Exp $
*
*
* NOTES
* NOTES
*
*
...
@@ -157,7 +157,8 @@ static IpcMemoryKey ipc_key;
...
@@ -157,7 +157,8 @@ static IpcMemoryKey ipc_key;
static
int
NextBackendId
=
MAXINT
;
/* XXX why? */
static
int
NextBackendId
=
MAXINT
;
/* XXX why? */
static
char
*
progname
=
(
char
*
)
NULL
;
static
char
*
progname
=
(
char
*
)
NULL
;
static
char
**
argv_name
;
static
char
**
real_argv
;
static
int
real_argc
;
/*
/*
* Default Values
* Default Values
...
@@ -296,10 +297,38 @@ PostmasterMain(int argc, char *argv[])
...
@@ -296,10 +297,38 @@ PostmasterMain(int argc, char *argv[])
int
silentflag
=
0
;
int
silentflag
=
0
;
bool
DataDirOK
;
/* We have a usable PGDATA value */
bool
DataDirOK
;
/* We have a usable PGDATA value */
char
hostbuf
[
MAXHOSTNAMELEN
];
char
hostbuf
[
MAXHOSTNAMELEN
];
int
nonblank_argc
;
progname
=
argv
[
0
];
argv_name
=
&
argv
[
0
];
/*
* We need three params so we can display status. If we don't
* get them from the user, let's make them ourselves.
*/
if
(
argc
<
4
)
{
int
i
;
char
*
new_argv
[
5
];
for
(
i
=
0
;
i
<
argc
;
i
++
)
new_argv
[
i
]
=
argv
[
i
];
for
(;
i
<
4
;
i
++
)
new_argv
[
i
]
=
""
;
new_argv
[
4
]
=
NULL
;
execv
(
new_argv
[
0
],
new_argv
);
perror
(
""
);
/* How did we get here, error! */
fprintf
(
stderr
,
"PostmasterMain execv failed on %s
\n
"
,
argv
[
0
]);
exit
(
1
);
}
progname
=
argv
[
0
];
real_argv
=
argv
;
real_argc
=
argc
;
/* don't process any dummy args we placed at the end for status display */
for
(
nonblank_argc
=
argc
;
argc
>
0
;
nonblank_argc
--
)
if
(
argv
[
argc
-
1
]
!=
NULL
&&
argv
[
argc
-
1
][
0
]
!=
'\0'
)
break
;
/*
/*
* for security, no dir or file created can be group or other
* for security, no dir or file created can be group or other
* accessible
* accessible
...
@@ -316,7 +345,7 @@ PostmasterMain(int argc, char *argv[])
...
@@ -316,7 +345,7 @@ PostmasterMain(int argc, char *argv[])
DataDir
=
getenv
(
"PGDATA"
);
/* default value */
DataDir
=
getenv
(
"PGDATA"
);
/* default value */
opterr
=
0
;
opterr
=
0
;
while
((
opt
=
getopt
(
argc
,
argv
,
"a:B:b:D:dim:Mno:p:Ss"
))
!=
EOF
)
while
((
opt
=
getopt
(
nonblank_
argc
,
argv
,
"a:B:b:D:dim:Mno:p:Ss"
))
!=
EOF
)
{
{
switch
(
opt
)
switch
(
opt
)
{
{
...
@@ -355,7 +384,7 @@ PostmasterMain(int argc, char *argv[])
...
@@ -355,7 +384,7 @@ PostmasterMain(int argc, char *argv[])
* Turn on debugging for the postmaster and the backend
* Turn on debugging for the postmaster and the backend
* servers descended from it.
* servers descended from it.
*/
*/
if
((
optind
<
argc
)
&&
*
argv
[
optind
]
!=
'-'
)
if
((
optind
<
nonblank_
argc
)
&&
*
argv
[
optind
]
!=
'-'
)
{
{
DebugLvl
=
atoi
(
argv
[
optind
]);
DebugLvl
=
atoi
(
argv
[
optind
]);
optind
++
;
optind
++
;
...
@@ -1195,7 +1224,7 @@ DoBackend(Port *port)
...
@@ -1195,7 +1224,7 @@ DoBackend(Port *port)
* a big win.
* a big win.
*/
*/
*
argv_name
=
Execfile
;
real_argv
[
0
]
=
Execfile
;
/* Tell the backend it is being called from the postmaster */
/* Tell the backend it is being called from the postmaster */
av
[
ac
++
]
=
"-p"
;
av
[
ac
++
]
=
"-p"
;
...
@@ -1252,7 +1281,7 @@ DoBackend(Port *port)
...
@@ -1252,7 +1281,7 @@ DoBackend(Port *port)
fprintf
(
stderr
,
")
\n
"
);
fprintf
(
stderr
,
")
\n
"
);
}
}
return
(
PostgresMain
(
ac
,
av
));
return
(
PostgresMain
(
ac
,
av
,
real_argc
,
real_argv
));
}
}
/*
/*
...
...
src/backend/rewrite/rewriteDefine.c
View file @
a576a60e
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteDefine.c,v 1.1
4 1998/01/13 04:04:12 scrappy
Exp $
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteDefine.c,v 1.1
5 1998/06/04 17:26:44 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -135,7 +135,7 @@ InsertRule(char *rulname,
...
@@ -135,7 +135,7 @@ InsertRule(char *rulname,
rulname
,
evtype
,
eventrel_oid
,
evslot_index
,
actionbuf
,
rulname
,
evtype
,
eventrel_oid
,
evslot_index
,
actionbuf
,
qualbuf
,
is_instead
);
qualbuf
,
is_instead
);
pg_exec_query
(
rulebuf
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
pg_exec_query
(
rulebuf
);
return
(
LastOidProcessed
);
return
(
LastOidProcessed
);
}
}
...
...
src/backend/tcop/postgres.c
View file @
a576a60e
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.7
2 1998/05/29 17:00:1
5 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.7
3 1998/06/04 17:26:4
5 momjian Exp $
*
*
* NOTES
* NOTES
* this is the "main" module of the postgres backend and
* this is the "main" module of the postgres backend and
...
@@ -94,6 +94,7 @@ static bool DebugPrintRewrittenParsetree = false;
...
@@ -94,6 +94,7 @@ static bool DebugPrintRewrittenParsetree = false;
/*static bool EnableRewrite = true; , never changes why have it*/
/*static bool EnableRewrite = true; , never changes why have it*/
CommandDest
whereToSendOutput
;
CommandDest
whereToSendOutput
;
const
char
**
ps_status
;
/* this is our 'ps' status, argv[3] */
#ifdef LOCK_MGR_DEBUG
#ifdef LOCK_MGR_DEBUG
extern
int
lockDebug
;
extern
int
lockDebug
;
...
@@ -594,16 +595,13 @@ pg_parse_and_plan(char *query_string, /* string to execute */
...
@@ -594,16 +595,13 @@ pg_parse_and_plan(char *query_string, /* string to execute */
*/
*/
void
void
pg_exec_query
(
char
*
query_string
,
char
**
argv
,
Oid
*
typev
,
int
nargs
)
pg_exec_query
(
char
*
query_string
)
{
{
pg_exec_query_dest
(
query_string
,
argv
,
typev
,
nargs
,
whereToSendOutput
);
pg_exec_query_dest
(
query_string
,
whereToSendOutput
);
}
}
void
void
pg_exec_query_dest
(
char
*
query_string
,
/* string to execute */
pg_exec_query_dest
(
char
*
query_string
,
/* string to execute */
char
**
argv
,
/* arguments */
Oid
*
typev
,
/* argument types */
int
nargs
,
/* number of arguments */
CommandDest
dest
)
/* where results should go */
CommandDest
dest
)
/* where results should go */
{
{
List
*
plan_list
;
List
*
plan_list
;
...
@@ -614,7 +612,7 @@ pg_exec_query_dest(char *query_string, /* string to execute */
...
@@ -614,7 +612,7 @@ pg_exec_query_dest(char *query_string, /* string to execute */
QueryTreeList
*
querytree_list
;
QueryTreeList
*
querytree_list
;
/* plan the queries */
/* plan the queries */
plan_list
=
pg_parse_and_plan
(
query_string
,
typev
,
nargs
,
&
querytree_list
,
dest
);
plan_list
=
pg_parse_and_plan
(
query_string
,
NULL
,
0
,
&
querytree_list
,
dest
);
if
(
QueryCancel
)
if
(
QueryCancel
)
CancelQuery
();
CancelQuery
();
...
@@ -697,7 +695,7 @@ pg_exec_query_dest(char *query_string, /* string to execute */
...
@@ -697,7 +695,7 @@ pg_exec_query_dest(char *query_string, /* string to execute */
time
(
&
tim
);
time
(
&
tim
);
printf
(
"
\t
ProcessQuery() at %s
\n
"
,
ctime
(
&
tim
));
printf
(
"
\t
ProcessQuery() at %s
\n
"
,
ctime
(
&
tim
));
}
}
ProcessQuery
(
querytree
,
plan
,
argv
,
typev
,
nargs
,
dest
);
ProcessQuery
(
querytree
,
plan
,
dest
);
}
}
if
(
ShowExecutorStats
)
if
(
ShowExecutorStats
)
...
@@ -827,7 +825,7 @@ usage(char *progname)
...
@@ -827,7 +825,7 @@ usage(char *progname)
* ----------------------------------------------------------------
* ----------------------------------------------------------------
*/
*/
int
int
PostgresMain
(
int
argc
,
char
*
argv
[])
PostgresMain
(
int
argc
,
char
*
argv
[]
,
int
real_argc
,
char
*
real_argv
[]
)
{
{
bool
flagC
=
false
,
bool
flagC
=
false
,
flagQ
=
false
,
flagQ
=
false
,
...
@@ -1230,6 +1228,25 @@ PostgresMain(int argc, char *argv[])
...
@@ -1230,6 +1228,25 @@ PostgresMain(int argc, char *argv[])
puts
(
"
\t
----------------
\n
"
);
puts
(
"
\t
----------------
\n
"
);
}
}
/* ----------------
* set process params for ps
* ----------------
*/
if
(
IsUnderPostmaster
)
{
int
i
;
Assert
(
real_argc
>=
4
);
real_argv
[
1
]
=
userName
;
real_argv
[
2
]
=
DBName
;
ps_status
=
(
const
char
**
)
&
real_argv
[
3
];
*
ps_status
=
"idle"
;
for
(
i
=
4
;
i
<
real_argc
;
i
++
)
real_argv
[
i
]
=
""
;
/* blank them */
}
/* we just put a dummy here so we don't have to test everywhere */
else
ps_status
=
malloc
(
sizeof
(
char
*
));
/* ----------------
/* ----------------
* initialize portal file descriptors
* initialize portal file descriptors
* ----------------
* ----------------
...
@@ -1297,7 +1314,7 @@ PostgresMain(int argc, char *argv[])
...
@@ -1297,7 +1314,7 @@ PostgresMain(int argc, char *argv[])
if
(
!
IsUnderPostmaster
)
if
(
!
IsUnderPostmaster
)
{
{
puts
(
"
\n
POSTGRES backend interactive interface"
);
puts
(
"
\n
POSTGRES backend interactive interface"
);
puts
(
"$Revision: 1.7
2 $ $Date: 1998/05/29 17:00:1
5 $"
);
puts
(
"$Revision: 1.7
3 $ $Date: 1998/06/04 17:26:4
5 $"
);
}
}
/* ----------------
/* ----------------
...
@@ -1347,6 +1364,7 @@ PostgresMain(int argc, char *argv[])
...
@@ -1347,6 +1364,7 @@ PostgresMain(int argc, char *argv[])
StartTransactionCommand
();
StartTransactionCommand
();
HandleFunctionRequest
();
HandleFunctionRequest
();
*
ps_status
=
"idle"
;
break
;
break
;
/* ----------------
/* ----------------
...
@@ -1383,7 +1401,9 @@ PostgresMain(int argc, char *argv[])
...
@@ -1383,7 +1401,9 @@ PostgresMain(int argc, char *argv[])
}
}
StartTransactionCommand
();
StartTransactionCommand
();
pg_exec_query
(
parser_input
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
pg_exec_query
(
parser_input
);
*
ps_status
=
"idle"
;
if
(
ShowStats
)
if
(
ShowStats
)
ShowUsage
();
ShowUsage
();
...
...
src/backend/tcop/pquery.c
View file @
a576a60e
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/pquery.c,v 1.1
5 1998/02/26 04:36:32
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/pquery.c,v 1.1
6 1998/06/04 17:26:47
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -41,6 +41,8 @@
...
@@ -41,6 +41,8 @@
static
char
*
CreateOperationTag
(
int
operationType
);
static
char
*
CreateOperationTag
(
int
operationType
);
static
void
ProcessQueryDesc
(
QueryDesc
*
queryDesc
);
static
void
ProcessQueryDesc
(
QueryDesc
*
queryDesc
);
extern
const
char
**
ps_status
;
/* from postgres.c */
/* ----------------------------------------------------------------
/* ----------------------------------------------------------------
* CreateQueryDesc
* CreateQueryDesc
...
@@ -226,7 +228,7 @@ ProcessQueryDesc(QueryDesc *queryDesc)
...
@@ -226,7 +228,7 @@ ProcessQueryDesc(QueryDesc *queryDesc)
plan
=
queryDesc
->
plantree
;
plan
=
queryDesc
->
plantree
;
operation
=
queryDesc
->
operation
;
operation
=
queryDesc
->
operation
;
tag
=
CreateOperationTag
(
operation
);
*
ps_status
=
tag
=
CreateOperationTag
(
operation
);
dest
=
queryDesc
->
dest
;
dest
=
queryDesc
->
dest
;
/* ----------------
/* ----------------
...
@@ -358,9 +360,6 @@ ProcessQueryDesc(QueryDesc *queryDesc)
...
@@ -358,9 +360,6 @@ ProcessQueryDesc(QueryDesc *queryDesc)
void
void
ProcessQuery
(
Query
*
parsetree
,
ProcessQuery
(
Query
*
parsetree
,
Plan
*
plan
,
Plan
*
plan
,
char
*
argv
[],
Oid
*
typev
,
int
nargs
,
CommandDest
dest
)
CommandDest
dest
)
{
{
QueryDesc
*
queryDesc
;
QueryDesc
*
queryDesc
;
...
...
src/backend/tcop/utility.c
View file @
a576a60e
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.3
8 1998/02/26 04:36:36
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.3
9 1998/06/04 17:26:48
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -60,6 +60,8 @@ void DefineUser(CreateUserStmt *stmt);
...
@@ -60,6 +60,8 @@ void DefineUser(CreateUserStmt *stmt);
void
AlterUser
(
AlterUserStmt
*
stmt
);
void
AlterUser
(
AlterUserStmt
*
stmt
);
void
RemoveUser
(
char
*
username
);
void
RemoveUser
(
char
*
username
);
extern
const
char
**
ps_status
;
/* from postgres.c */
/* ----------------
/* ----------------
* CHECK_IF_ABORTED() is used to avoid doing unnecessary
* CHECK_IF_ABORTED() is used to avoid doing unnecessary
* processing within an aborted transaction block.
* processing within an aborted transaction block.
...
@@ -102,18 +104,18 @@ ProcessUtility(Node *parsetree,
...
@@ -102,18 +104,18 @@ ProcessUtility(Node *parsetree,
switch
(
stmt
->
command
)
switch
(
stmt
->
command
)
{
{
case
BEGIN_TRANS
:
case
BEGIN_TRANS
:
commandTag
=
"BEGIN"
;
*
ps_status
=
commandTag
=
"BEGIN"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
BeginTransactionBlock
();
BeginTransactionBlock
();
break
;
break
;
case
END_TRANS
:
case
END_TRANS
:
commandTag
=
"END"
;
*
ps_status
=
commandTag
=
"END"
;
EndTransactionBlock
();
EndTransactionBlock
();
break
;
break
;
case
ABORT_TRANS
:
case
ABORT_TRANS
:
commandTag
=
"ABORT"
;
*
ps_status
=
commandTag
=
"ABORT"
;
UserAbortTransactionBlock
();
UserAbortTransactionBlock
();
break
;
break
;
}
}
...
@@ -128,7 +130,7 @@ ProcessUtility(Node *parsetree,
...
@@ -128,7 +130,7 @@ ProcessUtility(Node *parsetree,
{
{
ClosePortalStmt
*
stmt
=
(
ClosePortalStmt
*
)
parsetree
;
ClosePortalStmt
*
stmt
=
(
ClosePortalStmt
*
)
parsetree
;
commandTag
=
"CLOSE"
;
*
ps_status
=
commandTag
=
"CLOSE"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
PerformPortalClose
(
stmt
->
portalname
,
dest
);
PerformPortalClose
(
stmt
->
portalname
,
dest
);
...
@@ -142,7 +144,7 @@ ProcessUtility(Node *parsetree,
...
@@ -142,7 +144,7 @@ ProcessUtility(Node *parsetree,
bool
forward
;
bool
forward
;
int
count
;
int
count
;
commandTag
=
(
stmt
->
ismove
)
?
"MOVE"
:
"FETCH"
;
*
ps_status
=
commandTag
=
(
stmt
->
ismove
)
?
"MOVE"
:
"FETCH"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
forward
=
(
bool
)
(
stmt
->
direction
==
FORWARD
);
forward
=
(
bool
)
(
stmt
->
direction
==
FORWARD
);
...
@@ -163,7 +165,7 @@ ProcessUtility(Node *parsetree,
...
@@ -163,7 +165,7 @@ ProcessUtility(Node *parsetree,
*
*
*/
*/
case
T_CreateStmt
:
case
T_CreateStmt
:
commandTag
=
"CREATE"
;
*
ps_status
=
commandTag
=
"CREATE"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
DefineRelation
((
CreateStmt
*
)
parsetree
);
DefineRelation
((
CreateStmt
*
)
parsetree
);
...
@@ -176,7 +178,7 @@ ProcessUtility(Node *parsetree,
...
@@ -176,7 +178,7 @@ ProcessUtility(Node *parsetree,
List
*
args
=
stmt
->
relNames
;
List
*
args
=
stmt
->
relNames
;
Relation
rel
;
Relation
rel
;
commandTag
=
"DROP"
;
*
ps_status
=
commandTag
=
"DROP"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
foreach
(
arg
,
args
)
foreach
(
arg
,
args
)
...
@@ -216,7 +218,7 @@ ProcessUtility(Node *parsetree,
...
@@ -216,7 +218,7 @@ ProcessUtility(Node *parsetree,
{
{
CopyStmt
*
stmt
=
(
CopyStmt
*
)
parsetree
;
CopyStmt
*
stmt
=
(
CopyStmt
*
)
parsetree
;
commandTag
=
"COPY"
;
*
ps_status
=
commandTag
=
"COPY"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
DoCopy
(
stmt
->
relname
,
DoCopy
(
stmt
->
relname
,
...
@@ -238,7 +240,7 @@ ProcessUtility(Node *parsetree,
...
@@ -238,7 +240,7 @@ ProcessUtility(Node *parsetree,
{
{
AddAttrStmt
*
stmt
=
(
AddAttrStmt
*
)
parsetree
;
AddAttrStmt
*
stmt
=
(
AddAttrStmt
*
)
parsetree
;
commandTag
=
"ADD"
;
*
ps_status
=
commandTag
=
"ADD"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
/*
/*
...
@@ -259,7 +261,7 @@ ProcessUtility(Node *parsetree,
...
@@ -259,7 +261,7 @@ ProcessUtility(Node *parsetree,
{
{
RenameStmt
*
stmt
=
(
RenameStmt
*
)
parsetree
;
RenameStmt
*
stmt
=
(
RenameStmt
*
)
parsetree
;
commandTag
=
"RENAME"
;
*
ps_status
=
commandTag
=
"RENAME"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
relname
=
stmt
->
relname
;
relname
=
stmt
->
relname
;
...
@@ -317,7 +319,7 @@ ProcessUtility(Node *parsetree,
...
@@ -317,7 +319,7 @@ ProcessUtility(Node *parsetree,
AclItem
*
aip
;
AclItem
*
aip
;
unsigned
modechg
;
unsigned
modechg
;
commandTag
=
"CHANGE"
;
*
ps_status
=
commandTag
=
"CHANGE"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
aip
=
stmt
->
aclitem
;
aip
=
stmt
->
aclitem
;
...
@@ -350,7 +352,7 @@ ProcessUtility(Node *parsetree,
...
@@ -350,7 +352,7 @@ ProcessUtility(Node *parsetree,
{
{
DefineStmt
*
stmt
=
(
DefineStmt
*
)
parsetree
;
DefineStmt
*
stmt
=
(
DefineStmt
*
)
parsetree
;
commandTag
=
"CREATE"
;
*
ps_status
=
commandTag
=
"CREATE"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
switch
(
stmt
->
defType
)
switch
(
stmt
->
defType
)
...
@@ -376,14 +378,14 @@ ProcessUtility(Node *parsetree,
...
@@ -376,14 +378,14 @@ ProcessUtility(Node *parsetree,
{
{
ViewStmt
*
stmt
=
(
ViewStmt
*
)
parsetree
;
ViewStmt
*
stmt
=
(
ViewStmt
*
)
parsetree
;
commandTag
=
"CREATE"
;
*
ps_status
=
commandTag
=
"CREATE"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
DefineView
(
stmt
->
viewname
,
stmt
->
query
);
/* retrieve parsetree */
DefineView
(
stmt
->
viewname
,
stmt
->
query
);
/* retrieve parsetree */
}
}
break
;
break
;
case
T_ProcedureStmt
:
/* CREATE FUNCTION */
case
T_ProcedureStmt
:
/* CREATE FUNCTION */
commandTag
=
"CREATE"
;
*
ps_status
=
commandTag
=
"CREATE"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
CreateFunction
((
ProcedureStmt
*
)
parsetree
,
dest
);
/* everything */
CreateFunction
((
ProcedureStmt
*
)
parsetree
,
dest
);
/* everything */
break
;
break
;
...
@@ -392,7 +394,7 @@ ProcessUtility(Node *parsetree,
...
@@ -392,7 +394,7 @@ ProcessUtility(Node *parsetree,
{
{
IndexStmt
*
stmt
=
(
IndexStmt
*
)
parsetree
;
IndexStmt
*
stmt
=
(
IndexStmt
*
)
parsetree
;
commandTag
=
"CREATE"
;
*
ps_status
=
commandTag
=
"CREATE"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
DefineIndex
(
stmt
->
relname
,
/* relation name */
DefineIndex
(
stmt
->
relname
,
/* relation name */
stmt
->
idxname
,
/* index name */
stmt
->
idxname
,
/* index name */
...
@@ -416,14 +418,14 @@ ProcessUtility(Node *parsetree,
...
@@ -416,14 +418,14 @@ ProcessUtility(Node *parsetree,
if
(
aclcheck_result
!=
ACLCHECK_OK
)
if
(
aclcheck_result
!=
ACLCHECK_OK
)
elog
(
ERROR
,
"%s: %s"
,
relname
,
aclcheck_error_strings
[
aclcheck_result
]);
elog
(
ERROR
,
"%s: %s"
,
relname
,
aclcheck_error_strings
[
aclcheck_result
]);
#endif
#endif
commandTag
=
"CREATE"
;
*
ps_status
=
commandTag
=
"CREATE"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
DefineQueryRewrite
(
stmt
);
DefineQueryRewrite
(
stmt
);
}
}
break
;
break
;
case
T_CreateSeqStmt
:
case
T_CreateSeqStmt
:
commandTag
=
"CREATE"
;
*
ps_status
=
commandTag
=
"CREATE"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
DefineSequence
((
CreateSeqStmt
*
)
parsetree
);
DefineSequence
((
CreateSeqStmt
*
)
parsetree
);
...
@@ -433,7 +435,7 @@ ProcessUtility(Node *parsetree,
...
@@ -433,7 +435,7 @@ ProcessUtility(Node *parsetree,
{
{
ExtendStmt
*
stmt
=
(
ExtendStmt
*
)
parsetree
;
ExtendStmt
*
stmt
=
(
ExtendStmt
*
)
parsetree
;
commandTag
=
"EXTEND"
;
*
ps_status
=
commandTag
=
"EXTEND"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
ExtendIndex
(
stmt
->
idxname
,
/* index name */
ExtendIndex
(
stmt
->
idxname
,
/* index name */
...
@@ -446,7 +448,7 @@ ProcessUtility(Node *parsetree,
...
@@ -446,7 +448,7 @@ ProcessUtility(Node *parsetree,
{
{
RemoveStmt
*
stmt
=
(
RemoveStmt
*
)
parsetree
;
RemoveStmt
*
stmt
=
(
RemoveStmt
*
)
parsetree
;
commandTag
=
"DROP"
;
*
ps_status
=
commandTag
=
"DROP"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
switch
(
stmt
->
removeType
)
switch
(
stmt
->
removeType
)
...
@@ -510,7 +512,7 @@ ProcessUtility(Node *parsetree,
...
@@ -510,7 +512,7 @@ ProcessUtility(Node *parsetree,
{
{
RemoveAggrStmt
*
stmt
=
(
RemoveAggrStmt
*
)
parsetree
;
RemoveAggrStmt
*
stmt
=
(
RemoveAggrStmt
*
)
parsetree
;
commandTag
=
"DROP"
;
*
ps_status
=
commandTag
=
"DROP"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
RemoveAggregate
(
stmt
->
aggname
,
stmt
->
aggtype
);
RemoveAggregate
(
stmt
->
aggname
,
stmt
->
aggtype
);
}
}
...
@@ -520,7 +522,7 @@ ProcessUtility(Node *parsetree,
...
@@ -520,7 +522,7 @@ ProcessUtility(Node *parsetree,
{
{
RemoveFuncStmt
*
stmt
=
(
RemoveFuncStmt
*
)
parsetree
;
RemoveFuncStmt
*
stmt
=
(
RemoveFuncStmt
*
)
parsetree
;
commandTag
=
"DROP"
;
*
ps_status
=
commandTag
=
"DROP"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
RemoveFunction
(
stmt
->
funcname
,
RemoveFunction
(
stmt
->
funcname
,
length
(
stmt
->
args
),
length
(
stmt
->
args
),
...
@@ -534,7 +536,7 @@ ProcessUtility(Node *parsetree,
...
@@ -534,7 +536,7 @@ ProcessUtility(Node *parsetree,
char
*
type1
=
(
char
*
)
NULL
;
char
*
type1
=
(
char
*
)
NULL
;
char
*
type2
=
(
char
*
)
NULL
;
char
*
type2
=
(
char
*
)
NULL
;
commandTag
=
"DROP"
;
*
ps_status
=
commandTag
=
"DROP"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
if
(
lfirst
(
stmt
->
args
)
!=
NULL
)
if
(
lfirst
(
stmt
->
args
)
!=
NULL
)
...
@@ -555,7 +557,7 @@ ProcessUtility(Node *parsetree,
...
@@ -555,7 +557,7 @@ ProcessUtility(Node *parsetree,
{
{
CreatedbStmt
*
stmt
=
(
CreatedbStmt
*
)
parsetree
;
CreatedbStmt
*
stmt
=
(
CreatedbStmt
*
)
parsetree
;
commandTag
=
"CREATEDB"
;
*
ps_status
=
commandTag
=
"CREATEDB"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
createdb
(
stmt
->
dbname
,
stmt
->
dbpath
);
createdb
(
stmt
->
dbname
,
stmt
->
dbpath
);
}
}
...
@@ -565,7 +567,7 @@ ProcessUtility(Node *parsetree,
...
@@ -565,7 +567,7 @@ ProcessUtility(Node *parsetree,
{
{
DestroydbStmt
*
stmt
=
(
DestroydbStmt
*
)
parsetree
;
DestroydbStmt
*
stmt
=
(
DestroydbStmt
*
)
parsetree
;
commandTag
=
"DESTROYDB"
;
*
ps_status
=
commandTag
=
"DESTROYDB"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
destroydb
(
stmt
->
dbname
);
destroydb
(
stmt
->
dbname
);
}
}
...
@@ -576,7 +578,7 @@ ProcessUtility(Node *parsetree,
...
@@ -576,7 +578,7 @@ ProcessUtility(Node *parsetree,
{
{
NotifyStmt
*
stmt
=
(
NotifyStmt
*
)
parsetree
;
NotifyStmt
*
stmt
=
(
NotifyStmt
*
)
parsetree
;
commandTag
=
"NOTIFY"
;
*
ps_status
=
commandTag
=
"NOTIFY"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
Async_Notify
(
stmt
->
relname
);
Async_Notify
(
stmt
->
relname
);
...
@@ -587,7 +589,7 @@ ProcessUtility(Node *parsetree,
...
@@ -587,7 +589,7 @@ ProcessUtility(Node *parsetree,
{
{
ListenStmt
*
stmt
=
(
ListenStmt
*
)
parsetree
;
ListenStmt
*
stmt
=
(
ListenStmt
*
)
parsetree
;
commandTag
=
"LISTEN"
;
*
ps_status
=
commandTag
=
"LISTEN"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
Async_Listen
(
stmt
->
relname
,
MyProcPid
);
Async_Listen
(
stmt
->
relname
,
MyProcPid
);
...
@@ -604,7 +606,7 @@ ProcessUtility(Node *parsetree,
...
@@ -604,7 +606,7 @@ ProcessUtility(Node *parsetree,
FILE
*
fp
;
FILE
*
fp
;
char
*
filename
;
char
*
filename
;
commandTag
=
"LOAD"
;
*
ps_status
=
commandTag
=
"LOAD"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
filename
=
stmt
->
filename
;
filename
=
stmt
->
filename
;
...
@@ -620,7 +622,7 @@ ProcessUtility(Node *parsetree,
...
@@ -620,7 +622,7 @@ ProcessUtility(Node *parsetree,
{
{
ClusterStmt
*
stmt
=
(
ClusterStmt
*
)
parsetree
;
ClusterStmt
*
stmt
=
(
ClusterStmt
*
)
parsetree
;
commandTag
=
"CLUSTER"
;
*
ps_status
=
commandTag
=
"CLUSTER"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
cluster
(
stmt
->
relname
,
stmt
->
indexname
);
cluster
(
stmt
->
relname
,
stmt
->
indexname
);
...
@@ -628,7 +630,7 @@ ProcessUtility(Node *parsetree,
...
@@ -628,7 +630,7 @@ ProcessUtility(Node *parsetree,
break
;
break
;
case
T_VacuumStmt
:
case
T_VacuumStmt
:
commandTag
=
"VACUUM"
;
*
ps_status
=
commandTag
=
"VACUUM"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
vacuum
(((
VacuumStmt
*
)
parsetree
)
->
vacrel
,
vacuum
(((
VacuumStmt
*
)
parsetree
)
->
vacrel
,
((
VacuumStmt
*
)
parsetree
)
->
verbose
,
((
VacuumStmt
*
)
parsetree
)
->
verbose
,
...
@@ -640,7 +642,7 @@ ProcessUtility(Node *parsetree,
...
@@ -640,7 +642,7 @@ ProcessUtility(Node *parsetree,
{
{
ExplainStmt
*
stmt
=
(
ExplainStmt
*
)
parsetree
;
ExplainStmt
*
stmt
=
(
ExplainStmt
*
)
parsetree
;
commandTag
=
"EXPLAIN"
;
*
ps_status
=
commandTag
=
"EXPLAIN"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
ExplainQuery
(
stmt
->
query
,
stmt
->
verbose
,
dest
);
ExplainQuery
(
stmt
->
query
,
stmt
->
verbose
,
dest
);
...
@@ -654,7 +656,7 @@ ProcessUtility(Node *parsetree,
...
@@ -654,7 +656,7 @@ ProcessUtility(Node *parsetree,
{
{
RecipeStmt
*
stmt
=
(
RecipeStmt
*
)
parsetree
;
RecipeStmt
*
stmt
=
(
RecipeStmt
*
)
parsetree
;
commandTag
=
"EXECUTE RECIPE"
;
*
ps_status
=
commandTag
=
"EXECUTE RECIPE"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
beginRecipe
(
stmt
);
beginRecipe
(
stmt
);
}
}
...
@@ -668,7 +670,7 @@ ProcessUtility(Node *parsetree,
...
@@ -668,7 +670,7 @@ ProcessUtility(Node *parsetree,
VariableSetStmt
*
n
=
(
VariableSetStmt
*
)
parsetree
;
VariableSetStmt
*
n
=
(
VariableSetStmt
*
)
parsetree
;
SetPGVariable
(
n
->
name
,
n
->
value
);
SetPGVariable
(
n
->
name
,
n
->
value
);
commandTag
=
"SET VARIABLE"
;
*
ps_status
=
commandTag
=
"SET VARIABLE"
;
}
}
break
;
break
;
...
@@ -677,7 +679,7 @@ ProcessUtility(Node *parsetree,
...
@@ -677,7 +679,7 @@ ProcessUtility(Node *parsetree,
VariableShowStmt
*
n
=
(
VariableShowStmt
*
)
parsetree
;
VariableShowStmt
*
n
=
(
VariableShowStmt
*
)
parsetree
;
GetPGVariable
(
n
->
name
);
GetPGVariable
(
n
->
name
);
commandTag
=
"SHOW VARIABLE"
;
*
ps_status
=
commandTag
=
"SHOW VARIABLE"
;
}
}
break
;
break
;
...
@@ -686,7 +688,7 @@ ProcessUtility(Node *parsetree,
...
@@ -686,7 +688,7 @@ ProcessUtility(Node *parsetree,
VariableResetStmt
*
n
=
(
VariableResetStmt
*
)
parsetree
;
VariableResetStmt
*
n
=
(
VariableResetStmt
*
)
parsetree
;
ResetPGVariable
(
n
->
name
);
ResetPGVariable
(
n
->
name
);
commandTag
=
"RESET VARIABLE"
;
*
ps_status
=
commandTag
=
"RESET VARIABLE"
;
}
}
break
;
break
;
...
@@ -694,14 +696,14 @@ ProcessUtility(Node *parsetree,
...
@@ -694,14 +696,14 @@ ProcessUtility(Node *parsetree,
* ******************************** TRIGGER statements *******************************
* ******************************** TRIGGER statements *******************************
*/
*/
case
T_CreateTrigStmt
:
case
T_CreateTrigStmt
:
commandTag
=
"CREATE"
;
*
ps_status
=
commandTag
=
"CREATE"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
CreateTrigger
((
CreateTrigStmt
*
)
parsetree
);
CreateTrigger
((
CreateTrigStmt
*
)
parsetree
);
break
;
break
;
case
T_DropTrigStmt
:
case
T_DropTrigStmt
:
commandTag
=
"DROP"
;
*
ps_status
=
commandTag
=
"DROP"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
DropTrigger
((
DropTrigStmt
*
)
parsetree
);
DropTrigger
((
DropTrigStmt
*
)
parsetree
);
...
@@ -711,14 +713,14 @@ ProcessUtility(Node *parsetree,
...
@@ -711,14 +713,14 @@ ProcessUtility(Node *parsetree,
* ************* PROCEDURAL LANGUAGE statements *****************
* ************* PROCEDURAL LANGUAGE statements *****************
*/
*/
case
T_CreatePLangStmt
:
case
T_CreatePLangStmt
:
commandTag
=
"CREATE"
;
*
ps_status
=
commandTag
=
"CREATE"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
CreateProceduralLanguage
((
CreatePLangStmt
*
)
parsetree
);
CreateProceduralLanguage
((
CreatePLangStmt
*
)
parsetree
);
break
;
break
;
case
T_DropPLangStmt
:
case
T_DropPLangStmt
:
commandTag
=
"DROP"
;
*
ps_status
=
commandTag
=
"DROP"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
DropProceduralLanguage
((
DropPLangStmt
*
)
parsetree
);
DropProceduralLanguage
((
DropPLangStmt
*
)
parsetree
);
...
@@ -729,21 +731,21 @@ ProcessUtility(Node *parsetree,
...
@@ -729,21 +731,21 @@ ProcessUtility(Node *parsetree,
*
*
*/
*/
case
T_CreateUserStmt
:
case
T_CreateUserStmt
:
commandTag
=
"CREATE USER"
;
*
ps_status
=
commandTag
=
"CREATE USER"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
DefineUser
((
CreateUserStmt
*
)
parsetree
);
DefineUser
((
CreateUserStmt
*
)
parsetree
);
break
;
break
;
case
T_AlterUserStmt
:
case
T_AlterUserStmt
:
commandTag
=
"ALTER USER"
;
*
ps_status
=
commandTag
=
"ALTER USER"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
AlterUser
((
AlterUserStmt
*
)
parsetree
);
AlterUser
((
AlterUserStmt
*
)
parsetree
);
break
;
break
;
case
T_DropUserStmt
:
case
T_DropUserStmt
:
commandTag
=
"DROP USER"
;
*
ps_status
=
commandTag
=
"DROP USER"
;
CHECK_IF_ABORTED
();
CHECK_IF_ABORTED
();
RemoveUser
(((
DropUserStmt
*
)
parsetree
)
->
user
);
RemoveUser
(((
DropUserStmt
*
)
parsetree
)
->
user
);
...
...
src/include/tcop/pquery.h
View file @
a576a60e
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: pquery.h,v 1.
9 1998/02/26 04:43:40
momjian Exp $
* $Id: pquery.h,v 1.
10 1998/06/04 17:26:49
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -29,7 +29,6 @@ ProcessPortal(char *portalName, Query *parseTree,
...
@@ -29,7 +29,6 @@ ProcessPortal(char *portalName, Query *parseTree,
CommandDest
dest
);
CommandDest
dest
);
extern
void
extern
void
ProcessQuery
(
Query
*
parsetree
,
Plan
*
plan
,
char
*
argv
[],
ProcessQuery
(
Query
*
parsetree
,
Plan
*
plan
,
CommandDest
dest
);
Oid
*
typev
,
int
nargs
,
CommandDest
dest
);
#endif
/* pqueryIncluded */
#endif
/* pqueryIncluded */
src/include/tcop/tcopprot.h
View file @
a576a60e
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: tcopprot.h,v 1.1
3 1998/05/29 17:00:28
momjian Exp $
* $Id: tcopprot.h,v 1.1
4 1998/06/04 17:26:49
momjian Exp $
*
*
* OLD COMMENTS
* OLD COMMENTS
* This file was created so that other c files could get the two
* This file was created so that other c files could get the two
...
@@ -25,10 +25,9 @@
...
@@ -25,10 +25,9 @@
extern
List
*
extern
List
*
pg_parse_and_plan
(
char
*
query_string
,
Oid
*
typev
,
int
nargs
,
pg_parse_and_plan
(
char
*
query_string
,
Oid
*
typev
,
int
nargs
,
QueryTreeList
**
queryListP
,
CommandDest
dest
);
QueryTreeList
**
queryListP
,
CommandDest
dest
);
extern
void
pg_exec_query
(
char
*
query_string
,
char
**
argv
,
Oid
*
typev
,
int
nargs
);
extern
void
pg_exec_query
(
char
*
query_string
);
extern
void
extern
void
pg_exec_query_dest
(
char
*
query_string
,
char
**
argv
,
Oid
*
typev
,
pg_exec_query_dest
(
char
*
query_string
,
CommandDest
dest
);
int
nargs
,
CommandDest
dest
);
#endif
/* BOOTSTRAP_HEADER */
#endif
/* BOOTSTRAP_HEADER */
...
@@ -37,7 +36,8 @@ extern void quickdie(SIGNAL_ARGS);
...
@@ -37,7 +36,8 @@ extern void quickdie(SIGNAL_ARGS);
extern
void
die
(
SIGNAL_ARGS
);
extern
void
die
(
SIGNAL_ARGS
);
extern
void
FloatExceptionHandler
(
SIGNAL_ARGS
);
extern
void
FloatExceptionHandler
(
SIGNAL_ARGS
);
extern
void
CancelQuery
(
void
);
extern
void
CancelQuery
(
void
);
extern
int
PostgresMain
(
int
argc
,
char
*
argv
[]);
extern
int
PostgresMain
(
int
argc
,
char
*
argv
[],
int
real_argc
,
char
*
real_argv
[]);
extern
void
ResetUsage
(
void
);
extern
void
ResetUsage
(
void
);
extern
void
ShowUsage
(
void
);
extern
void
ShowUsage
(
void
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment