File tree 8 files changed +56
-17
lines changed 8 files changed +56
-17
lines changed Original file line number Diff line number Diff line change 1
1
<!--
2
- $Header: /cvsroot/pgsql/doc/src/sgml/ref/vacuumdb.sgml,v 1.20 2001/12/08 03:24:40 thomas Exp $
2
+ $Header: /cvsroot/pgsql/doc/src/sgml/ref/vacuumdb.sgml,v 1.21 2002/02/18 05:48:43 momjian Exp $
3
3
PostgreSQL documentation
4
4
-->
5
5
@@ -23,13 +23,13 @@ PostgreSQL documentation
23
23
<cmdsynopsis>
24
24
<command>vacuumdb</command>
25
25
<arg rep="repeat"><replaceable>connection-options</replaceable></arg>
26
- <arg><arg>-d</arg> <replaceable>dbname</replaceable></arg>
27
26
<group><arg>--full</arg><arg>-f</arg></group>
28
27
<group><arg>--verbose</arg><arg>-v</arg></group>
29
28
<group><arg>--analyze</arg><arg>-z</arg></group>
30
- <arg>--table '<replaceable>table</replaceable>
29
+ <arg>--table | -t '<replaceable>table</replaceable>
31
30
<arg>( <replaceable class="parameter">column</replaceable> [,...] )</arg>'
32
31
</arg>
32
+ <arg><replaceable>dbname</replaceable></arg>
33
33
<sbr>
34
34
<command>vacuumdb</command>
35
35
<arg rep="repeat"><replaceable>connection-options</replaceable></arg>
Original file line number Diff line number Diff line change 12
12
#
13
13
#
14
14
# IDENTIFICATION
15
- # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createdb,v 1.18 2001/09/30 22:17:51 momjian Exp $
15
+ # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createdb,v 1.19 2002/02/18 05:48:44 momjian Exp $
16
16
#
17
17
# -------------------------------------------------------------------------
18
18
104
104
exit 1
105
105
;;
106
106
* )
107
- if [ -z " $dbname " ]; then
108
- dbname=" $1 "
109
- else
107
+ dbname=" $1 "
108
+ if [ " $2 " ]
109
+ then
110
+ shift
110
111
dbcomment=" $1 "
111
112
fi
113
+ if [ " $# " -ne 1 ]; then
114
+ echo " $CMDNAME : invalid option: $2 " 1>&2
115
+ echo " Try '$CMDNAME --help' for more information." 1>&2
116
+ exit 1
117
+ fi
112
118
;;
113
119
esac
114
120
shift
@@ -118,7 +124,7 @@ if [ "$usage" ]; then
118
124
echo " $CMDNAME creates a PostgreSQL database."
119
125
echo
120
126
echo " Usage:"
121
- echo " $CMDNAME [options] dbname [description]"
127
+ echo " $CMDNAME [options] [ dbname] [description]"
122
128
echo
123
129
echo " Options:"
124
130
echo " -D, --location=PATH Alternative place to store the database"
Original file line number Diff line number Diff line change 7
7
# Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
8
8
# Portions Copyright (c) 1994, Regents of the University of California
9
9
#
10
- # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.32 2002/01/03 05:30:04 momjian Exp $
10
+ # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.33 2002/02/18 05:48:44 momjian Exp $
11
11
#
12
12
# -------------------------------------------------------------------------
13
13
116
116
fi
117
117
else dbname=" $1 "
118
118
fi
119
+ if [ " $# " -ne 1 ]; then
120
+ echo " $CMDNAME : invalid option: $2 " 1>&2
121
+ echo " Try '$CMDNAME --help' for more information." 1>&2
122
+ exit 1
123
+ fi
119
124
;;
120
125
esac
121
126
shift
Original file line number Diff line number Diff line change 9
9
#
10
10
#
11
11
# IDENTIFICATION
12
- # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.22 2001/09/30 22:17:51 momjian Exp $
12
+ # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.23 2002/02/18 05:48:44 momjian Exp $
13
13
#
14
14
# Note - this should NOT be setuid.
15
15
#
123
123
;;
124
124
* )
125
125
NewUser=" $1 "
126
+ if [ " $# " -ne 1 ]; then
127
+ echo " $CMDNAME : invalid option: $2 " 1>&2
128
+ echo " Try '$CMDNAME --help' for more information." 1>&2
129
+ exit 1
130
+ fi
126
131
;;
127
132
esac
128
133
shift ;
Original file line number Diff line number Diff line change 11
11
#
12
12
#
13
13
# IDENTIFICATION
14
- # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropdb,v 1.13 2001/09/30 22:17:51 momjian Exp $
14
+ # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropdb,v 1.14 2002/02/18 05:48:44 momjian Exp $
15
15
#
16
16
# -------------------------------------------------------------------------
17
17
89
89
;;
90
90
* )
91
91
dbname=" $1 "
92
+ if [ " $# " -ne 1 ]; then
93
+ echo " $CMDNAME : invalid option: $2 " 1>&2
94
+ echo " Try '$CMDNAME --help' for more information." 1>&2
95
+ exit 1
96
+ fi
92
97
;;
93
98
esac
94
99
shift
Original file line number Diff line number Diff line change 7
7
# Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
8
8
# Portions Copyright (c) 1994, Regents of the University of California
9
9
#
10
- # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/droplang,v 1.20 2002/01/03 08:53:00 momjian Exp $
10
+ # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/droplang,v 1.21 2002/02/18 05:48:44 momjian Exp $
11
11
#
12
12
# -------------------------------------------------------------------------
13
13
105
105
fi
106
106
else dbname=" $1 "
107
107
fi
108
+ if [ " $# " -ne 1 ]; then
109
+ echo " $CMDNAME : invalid option: $2 " 1>&2
110
+ echo " Try '$CMDNAME --help' for more information." 1>&2
111
+ exit 1
112
+ fi
108
113
;;
109
114
esac
110
115
shift
Original file line number Diff line number Diff line change 9
9
#
10
10
#
11
11
# IDENTIFICATION
12
- # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropuser,v 1.14 2001/09/30 22:17:51 momjian Exp $
12
+ # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropuser,v 1.15 2002/02/18 05:48:45 momjian Exp $
13
13
#
14
14
# Note - this should NOT be setuid.
15
15
#
91
91
;;
92
92
* )
93
93
DelUser=" $1 "
94
+ if [ " $# " -ne 1 ]; then
95
+ echo " $CMDNAME : invalid option: $2 " 1>&2
96
+ echo " Try '$CMDNAME --help' for more information." 1>&2
97
+ exit 1
98
+ fi
94
99
;;
95
100
esac
96
101
shift ;
Original file line number Diff line number Diff line change 12
12
#
13
13
#
14
14
# IDENTIFICATION
15
- # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/vacuumdb,v 1.19 2001/09/30 22:17:51 momjian Exp $
15
+ # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/vacuumdb,v 1.20 2002/02/18 05:48:45 momjian Exp $
16
16
#
17
17
# -------------------------------------------------------------------------
18
18
112
112
;;
113
113
* )
114
114
dbname=" $1 "
115
+ if [ " $# " -ne 1 ]; then
116
+ echo " $CMDNAME : invalid option: $2 " 1>&2
117
+ echo " Try '$CMDNAME --help' for more information." 1>&2
118
+ exit 1
119
+ fi
115
120
;;
116
121
esac
117
122
shift
@@ -151,9 +156,12 @@ if [ "$alldb" ]; then
151
156
dbname=` ${PATHNAME} psql $PSQLOPT -q -t -A -d template1 -c ' SELECT datname FROM pg_database WHERE datallowconn' `
152
157
153
158
elif [ -z " $dbname " ]; then
154
- echo " $CMDNAME : missing required argument: database name" 1>&2
155
- echo " Try '$CMDNAME -?' for help." 1>&2
156
- exit 1
159
+ if [ " $PGUSER " ]; then
160
+ dbname=" $PGUSER "
161
+ else
162
+ dbname=` ${PATHNAME} pg_id -u -n`
163
+ fi
164
+ [ " $? " -ne 0 ] && exit 1
157
165
fi
158
166
159
167
for db in $dbname
You can’t perform that action at this time.
0 commit comments