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
36a9cf38
Commit
36a9cf38
authored
Feb 18, 2009
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add --freeze option to vacuumdb.
parent
1d88d4e2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
10 deletions
+30
-10
doc/src/sgml/ref/vacuumdb.sgml
doc/src/sgml/ref/vacuumdb.sgml
+13
-1
src/bin/scripts/vacuumdb.c
src/bin/scripts/vacuumdb.c
+17
-9
No files found.
doc/src/sgml/ref/vacuumdb.sgml
View file @
36a9cf38
<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/vacuumdb.sgml,v 1.4
2 2007/12/11 19:57:32 tgl
Exp $
$PostgreSQL: pgsql/doc/src/sgml/ref/vacuumdb.sgml,v 1.4
3 2009/02/18 12:11:55 momjian
Exp $
PostgreSQL documentation
-->
...
...
@@ -26,6 +26,7 @@ PostgreSQL documentation
<group><arg>--full</arg><arg>-f</arg></group>
<group><arg>--verbose</arg><arg>-v</arg></group>
<group><arg>--analyze</arg><arg>-z</arg></group>
<group><arg>--freeze</arg><arg>-F</arg></group>
<arg>--table | -t <replaceable>table</replaceable>
<arg>( <replaceable class="parameter">column</replaceable> [,...] )</arg>
</arg>
...
...
@@ -37,6 +38,7 @@ PostgreSQL documentation
<group><arg>--full</arg><arg>-f</arg></group>
<group><arg>--verbose</arg><arg>-v</arg></group>
<group><arg>--analyze</arg><arg>-z</arg></group>
<group><arg>--freeze</arg><arg>-F</arg></group>
</cmdsynopsis>
</refsynopsisdiv>
...
...
@@ -161,6 +163,16 @@ PostgreSQL documentation
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-F</option></term>
<term><option>--freeze</option></term>
<listitem>
<para>
Aggressively <quote>freeze</quote> tuples.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
...
...
src/bin/scripts/vacuumdb.c
View file @
36a9cf38
...
...
@@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/bin/scripts/vacuumdb.c,v 1.2
2 2009/01/01 17:23
:55 momjian Exp $
* $PostgreSQL: pgsql/src/bin/scripts/vacuumdb.c,v 1.2
3 2009/02/18 12:11
:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -15,11 +15,11 @@
static
void
vacuum_one_database
(
const
char
*
dbname
,
bool
full
,
bool
verbose
,
bool
analyze
,
const
char
*
table
,
bool
freeze
,
const
char
*
table
,
const
char
*
host
,
const
char
*
port
,
const
char
*
username
,
bool
password
,
const
char
*
progname
,
bool
echo
);
static
void
vacuum_all_databases
(
bool
full
,
bool
verbose
,
bool
analyze
,
static
void
vacuum_all_databases
(
bool
full
,
bool
verbose
,
bool
analyze
,
bool
freeze
,
const
char
*
host
,
const
char
*
port
,
const
char
*
username
,
bool
password
,
const
char
*
progname
,
bool
echo
,
bool
quiet
);
...
...
@@ -39,6 +39,7 @@ main(int argc, char *argv[])
{
"quiet"
,
no_argument
,
NULL
,
'q'
},
{
"dbname"
,
required_argument
,
NULL
,
'd'
},
{
"analyze"
,
no_argument
,
NULL
,
'z'
},
{
"freeze"
,
no_argument
,
NULL
,
'F'
},
{
"all"
,
no_argument
,
NULL
,
'a'
},
{
"table"
,
required_argument
,
NULL
,
't'
},
{
"full"
,
no_argument
,
NULL
,
'f'
},
...
...
@@ -58,6 +59,7 @@ main(int argc, char *argv[])
bool
echo
=
false
;
bool
quiet
=
false
;
bool
analyze
=
false
;
bool
freeze
=
false
;
bool
alldb
=
false
;
char
*
table
=
NULL
;
bool
full
=
false
;
...
...
@@ -68,7 +70,7 @@ main(int argc, char *argv[])
handle_help_version_opts
(
argc
,
argv
,
"vacuumdb"
,
help
);
while
((
c
=
getopt_long
(
argc
,
argv
,
"h:p:U:Weqd:zat:fv"
,
long_options
,
&
optindex
))
!=
-
1
)
while
((
c
=
getopt_long
(
argc
,
argv
,
"h:p:U:Weqd:za
F
t:fv"
,
long_options
,
&
optindex
))
!=
-
1
)
{
switch
(
c
)
{
...
...
@@ -96,6 +98,9 @@ main(int argc, char *argv[])
case
'z'
:
analyze
=
true
;
break
;
case
'F'
:
freeze
=
true
;
break
;
case
'a'
:
alldb
=
true
;
break
;
...
...
@@ -145,7 +150,7 @@ main(int argc, char *argv[])
exit
(
1
);
}
vacuum_all_databases
(
full
,
verbose
,
analyze
,
vacuum_all_databases
(
full
,
verbose
,
analyze
,
freeze
,
host
,
port
,
username
,
password
,
progname
,
echo
,
quiet
);
}
...
...
@@ -161,7 +166,7 @@ main(int argc, char *argv[])
dbname
=
get_user_name
(
progname
);
}
vacuum_one_database
(
dbname
,
full
,
verbose
,
analyze
,
table
,
vacuum_one_database
(
dbname
,
full
,
verbose
,
analyze
,
freeze
,
table
,
host
,
port
,
username
,
password
,
progname
,
echo
);
}
...
...
@@ -172,7 +177,7 @@ main(int argc, char *argv[])
static
void
vacuum_one_database
(
const
char
*
dbname
,
bool
full
,
bool
verbose
,
bool
analyze
,
const
char
*
table
,
bool
freeze
,
const
char
*
table
,
const
char
*
host
,
const
char
*
port
,
const
char
*
username
,
bool
password
,
const
char
*
progname
,
bool
echo
)
...
...
@@ -190,6 +195,8 @@ vacuum_one_database(const char *dbname, bool full, bool verbose, bool analyze,
appendPQExpBuffer
(
&
sql
,
" VERBOSE"
);
if
(
analyze
)
appendPQExpBuffer
(
&
sql
,
" ANALYZE"
);
if
(
freeze
)
appendPQExpBuffer
(
&
sql
,
" FREEZE"
);
if
(
table
)
appendPQExpBuffer
(
&
sql
,
" %s"
,
table
);
appendPQExpBuffer
(
&
sql
,
";
\n
"
);
...
...
@@ -212,7 +219,7 @@ vacuum_one_database(const char *dbname, bool full, bool verbose, bool analyze,
static
void
vacuum_all_databases
(
bool
full
,
bool
verbose
,
bool
analyze
,
vacuum_all_databases
(
bool
full
,
bool
verbose
,
bool
analyze
,
bool
freeze
,
const
char
*
host
,
const
char
*
port
,
const
char
*
username
,
bool
password
,
const
char
*
progname
,
bool
echo
,
bool
quiet
)
...
...
@@ -235,7 +242,7 @@ vacuum_all_databases(bool full, bool verbose, bool analyze,
fflush
(
stdout
);
}
vacuum_one_database
(
dbname
,
full
,
verbose
,
analyze
,
NULL
,
vacuum_one_database
(
dbname
,
full
,
verbose
,
analyze
,
freeze
,
NULL
,
host
,
port
,
username
,
password
,
progname
,
echo
);
}
...
...
@@ -256,6 +263,7 @@ help(const char *progname)
printf
(
_
(
" -t, --table='TABLE[(COLUMNS)]' vacuum specific table only
\n
"
));
printf
(
_
(
" -f, --full do full vacuuming
\n
"
));
printf
(
_
(
" -z, --analyze update optimizer hints
\n
"
));
printf
(
_
(
" -F, --freeze freeze row transaction information
\n
"
));
printf
(
_
(
" -e, --echo show the commands being sent to the server
\n
"
));
printf
(
_
(
" -q, --quiet don't write any messages
\n
"
));
printf
(
_
(
" -v, --verbose write a lot of output
\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