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
8df6b2b5
Commit
8df6b2b5
authored
Oct 28, 2000
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add --version and --help options to "postgres".
parent
6707ede8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
12 deletions
+30
-12
src/backend/tcop/postgres.c
src/backend/tcop/postgres.c
+30
-12
No files found.
src/backend/tcop/postgres.c
View file @
8df6b2b5
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.18
2 2000/10/26 17:31:35 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.18
3 2000/10/28 01:07:00 petere
Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
...
...
@@ -1111,7 +1111,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
optind
=
1
;
/* reset after postmaster's usage */
while
((
flag
=
getopt
(
argc
,
argv
,
"A:B:CD:d:Eef:FiLNOPo:p:S:st:v:W:x:-:"
))
!=
EOF
)
while
((
flag
=
getopt
(
argc
,
argv
,
"A:B:CD:d:Eef:FiLNOPo:p:S:st:v:W:x:-:
?
"
))
!=
EOF
)
switch
(
flag
)
{
case
'A'
:
...
...
@@ -1385,6 +1385,16 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
char
*
name
,
*
value
;
ParseLongOption
(
optarg
,
&
name
,
&
value
);
if
(
strcmp
(
name
,
"help"
)
==
0
)
{
usage
(
argv
[
0
]);
exit
(
0
);
}
else
if
(
strcmp
(
name
,
"version"
)
==
0
)
{
puts
(
"postgres (PostgreSQL) "
PG_VERSION
);
exit
(
0
);
}
if
(
!
value
)
elog
(
ERROR
,
"--%s requires argument"
,
optarg
);
...
...
@@ -1395,15 +1405,23 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
break
;
}
case
'?'
:
if
(
strcmp
(
argv
[
optind
-
1
],
"-?"
)
==
0
)
{
usage
(
argv
[
0
]);
exit
(
0
);
}
else
errs
++
;
break
;
default:
/* ----------------
* default: bad command line option
* ----------------
*/
/* shouldn't get here */
errs
++
;
break
;
}
if
(
Show_query_stats
&&
(
Show_parser_stats
||
Show_planner_stats
||
Show_executor_stats
))
{
...
...
@@ -1470,8 +1488,8 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
/* noninteractive case: nothing should be left after switches */
if
(
errs
||
argc
!=
optind
||
DBName
==
NULL
)
{
usage
(
argv
[
0
]);
proc_exit
(
0
);
fprintf
(
stderr
,
"%s: invalid command line arguments
\n
Try -? for help.
\n
"
,
argv
[
0
]);
proc_exit
(
1
);
}
pq_init
();
/* initialize libpq at backend startup */
whereToSendOutput
=
Remote
;
...
...
@@ -1483,8 +1501,8 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
whereToSendOutput
=
Debug
;
if
(
errs
||
argc
-
optind
>
1
)
{
usage
(
argv
[
0
]);
proc_exit
(
0
);
fprintf
(
stderr
,
"%s: invalid command line arguments
\n
Try -? for help.
\n
"
,
argv
[
0
]);
proc_exit
(
1
);
}
else
if
(
argc
-
optind
==
1
)
DBName
=
argv
[
optind
];
...
...
@@ -1492,7 +1510,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
{
fprintf
(
stderr
,
"%s: user name undefined and no database specified
\n
"
,
argv
[
0
]);
proc_exit
(
0
);
proc_exit
(
1
);
}
/*
...
...
@@ -1618,7 +1636,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
if
(
!
IsUnderPostmaster
)
{
puts
(
"
\n
POSTGRES backend interactive interface "
);
puts
(
"$Revision: 1.18
2 $ $Date: 2000/10/26 17:31:35
$
\n
"
);
puts
(
"$Revision: 1.18
3 $ $Date: 2000/10/28 01:07:00
$
\n
"
);
}
/*
...
...
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