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