Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit36a9cf3

Browse files
committed
Add --freeze option to vacuumdb.
1 parent1d88d4e commit36a9cf3

File tree

2 files changed

+30
-10
lines changed

2 files changed

+30
-10
lines changed

‎doc/src/sgml/ref/vacuumdb.sgml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/vacuumdb.sgml,v 1.42 2007/12/11 19:57:32 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/vacuumdb.sgml,v 1.43 2009/02/18 12:11:55 momjian Exp $
33
PostgreSQL documentation
44
-->
55

@@ -26,6 +26,7 @@ PostgreSQL documentation
2626
<group><arg>--full</arg><arg>-f</arg></group>
2727
<group><arg>--verbose</arg><arg>-v</arg></group>
2828
<group><arg>--analyze</arg><arg>-z</arg></group>
29+
<group><arg>--freeze</arg><arg>-F</arg></group>
2930
<arg>--table | -t <replaceable>table</replaceable>
3031
<arg>( <replaceable class="parameter">column</replaceable> [,...] )</arg>
3132
</arg>
@@ -37,6 +38,7 @@ PostgreSQL documentation
3738
<group><arg>--full</arg><arg>-f</arg></group>
3839
<group><arg>--verbose</arg><arg>-v</arg></group>
3940
<group><arg>--analyze</arg><arg>-z</arg></group>
41+
<group><arg>--freeze</arg><arg>-F</arg></group>
4042
</cmdsynopsis>
4143
</refsynopsisdiv>
4244

@@ -161,6 +163,16 @@ PostgreSQL documentation
161163
</para>
162164
</listitem>
163165
</varlistentry>
166+
167+
<varlistentry>
168+
<term><option>-F</option></term>
169+
<term><option>--freeze</option></term>
170+
<listitem>
171+
<para>
172+
Aggressively <quote>freeze</quote> tuples.
173+
</para>
174+
</listitem>
175+
</varlistentry>
164176
</variablelist>
165177
</para>
166178

‎src/bin/scripts/vacuumdb.c

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
66
* Portions Copyright (c) 1994, Regents of the University of California
77
*
8-
* $PostgreSQL: pgsql/src/bin/scripts/vacuumdb.c,v 1.22 2009/01/01 17:23:55 momjian Exp $
8+
* $PostgreSQL: pgsql/src/bin/scripts/vacuumdb.c,v 1.23 2009/02/18 12:11:55 momjian Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -15,11 +15,11 @@
1515

1616

1717
staticvoidvacuum_one_database(constchar*dbname,boolfull,boolverbose,boolanalyze,
18-
constchar*table,
18+
boolfreeze,constchar*table,
1919
constchar*host,constchar*port,
2020
constchar*username,boolpassword,
2121
constchar*progname,boolecho);
22-
staticvoidvacuum_all_databases(boolfull,boolverbose,boolanalyze,
22+
staticvoidvacuum_all_databases(boolfull,boolverbose,boolanalyze,boolfreeze,
2323
constchar*host,constchar*port,
2424
constchar*username,boolpassword,
2525
constchar*progname,boolecho,boolquiet);
@@ -39,6 +39,7 @@ main(int argc, char *argv[])
3939
{"quiet",no_argument,NULL,'q'},
4040
{"dbname",required_argument,NULL,'d'},
4141
{"analyze",no_argument,NULL,'z'},
42+
{"freeze",no_argument,NULL,'F'},
4243
{"all",no_argument,NULL,'a'},
4344
{"table",required_argument,NULL,'t'},
4445
{"full",no_argument,NULL,'f'},
@@ -58,6 +59,7 @@ main(int argc, char *argv[])
5859
boolecho= false;
5960
boolquiet= false;
6061
boolanalyze= false;
62+
boolfreeze= false;
6163
boolalldb= false;
6264
char*table=NULL;
6365
boolfull= false;
@@ -68,7 +70,7 @@ main(int argc, char *argv[])
6870

6971
handle_help_version_opts(argc,argv,"vacuumdb",help);
7072

71-
while ((c=getopt_long(argc,argv,"h:p:U:Weqd:zat:fv",long_options,&optindex))!=-1)
73+
while ((c=getopt_long(argc,argv,"h:p:U:Weqd:zaFt:fv",long_options,&optindex))!=-1)
7274
{
7375
switch (c)
7476
{
@@ -96,6 +98,9 @@ main(int argc, char *argv[])
9698
case'z':
9799
analyze= true;
98100
break;
101+
case'F':
102+
freeze= true;
103+
break;
99104
case'a':
100105
alldb= true;
101106
break;
@@ -145,7 +150,7 @@ main(int argc, char *argv[])
145150
exit(1);
146151
}
147152

148-
vacuum_all_databases(full,verbose,analyze,
153+
vacuum_all_databases(full,verbose,analyze,freeze,
149154
host,port,username,password,
150155
progname,echo,quiet);
151156
}
@@ -161,7 +166,7 @@ main(int argc, char *argv[])
161166
dbname=get_user_name(progname);
162167
}
163168

164-
vacuum_one_database(dbname,full,verbose,analyze,table,
169+
vacuum_one_database(dbname,full,verbose,analyze,freeze,table,
165170
host,port,username,password,
166171
progname,echo);
167172
}
@@ -172,7 +177,7 @@ main(int argc, char *argv[])
172177

173178
staticvoid
174179
vacuum_one_database(constchar*dbname,boolfull,boolverbose,boolanalyze,
175-
constchar*table,
180+
boolfreeze,constchar*table,
176181
constchar*host,constchar*port,
177182
constchar*username,boolpassword,
178183
constchar*progname,boolecho)
@@ -190,6 +195,8 @@ vacuum_one_database(const char *dbname, bool full, bool verbose, bool analyze,
190195
appendPQExpBuffer(&sql," VERBOSE");
191196
if (analyze)
192197
appendPQExpBuffer(&sql," ANALYZE");
198+
if (freeze)
199+
appendPQExpBuffer(&sql," FREEZE");
193200
if (table)
194201
appendPQExpBuffer(&sql," %s",table);
195202
appendPQExpBuffer(&sql,";\n");
@@ -212,7 +219,7 @@ vacuum_one_database(const char *dbname, bool full, bool verbose, bool analyze,
212219

213220

214221
staticvoid
215-
vacuum_all_databases(boolfull,boolverbose,boolanalyze,
222+
vacuum_all_databases(boolfull,boolverbose,boolanalyze,boolfreeze,
216223
constchar*host,constchar*port,
217224
constchar*username,boolpassword,
218225
constchar*progname,boolecho,boolquiet)
@@ -235,7 +242,7 @@ vacuum_all_databases(bool full, bool verbose, bool analyze,
235242
fflush(stdout);
236243
}
237244

238-
vacuum_one_database(dbname,full,verbose,analyze,NULL,
245+
vacuum_one_database(dbname,full,verbose,analyze,freeze,NULL,
239246
host,port,username,password,
240247
progname,echo);
241248
}
@@ -256,6 +263,7 @@ help(const char *progname)
256263
printf(_(" -t, --table='TABLE[(COLUMNS)]' vacuum specific table only\n"));
257264
printf(_(" -f, --full do full vacuuming\n"));
258265
printf(_(" -z, --analyze update optimizer hints\n"));
266+
printf(_(" -F, --freeze freeze row transaction information\n"));
259267
printf(_(" -e, --echo show the commands being sent to the server\n"));
260268
printf(_(" -q, --quiet don't write any messages\n"));
261269
printf(_(" -v, --verbose write a lot of output\n"));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp