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

Commit17dc173

Browse files
committed
To reduce confusion over whether VACUUM FULL is needed for anti-wraparound
vacuuming (it's not), say "database-wide VACUUM" instead of "full-databaseVACUUM" in the relevant hint messages. Also, document the permissions neededto do this. Per today's discussion.
1 parentd9346f2 commit17dc173

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed

‎doc/src/sgml/maintenance.sgml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/maintenance.sgml,v 1.87 2008/12/08 20:30:58 mha Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/maintenance.sgml,v 1.88 2008/12/11 18:16:18 tgl Exp $ -->
22

33
<chapter id="maintenance">
44
<title>Routine Database Maintenance Tasks</title>
@@ -472,9 +472,13 @@ SELECT datname, age(datfrozenxid) FROM pg_database;
472472

473473
<programlisting>
474474
WARNING: database "mydb" must be vacuumed within 177009986 transactions
475-
HINT: To avoid a database shutdown, execute afull-database VACUUM in "mydb".
475+
HINT: To avoid a database shutdown, execute a database-wide VACUUM in "mydb".
476476
</programlisting>
477477

478+
(A manual <command>VACUUM</> should fix the problem, as suggested by the
479+
hint; but note that the <command>VACUUM</> must be performed by a
480+
superuser, else it will fail to process system catalogs and thus not
481+
be able to advance the database's <structfield>datfrozenxid</>.)
478482
If these warnings are
479483
ignored, the system will shut down and refuse to execute any new
480484
transactions once there are fewer than 1 million transactions left

‎doc/src/sgml/ref/vacuum.sgml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/vacuum.sgml,v 1.53 2008/11/14 10:22:47 petere Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/vacuum.sgml,v 1.54 2008/12/11 18:16:18 tgl Exp $
33
PostgreSQL documentation
44
-->
55

@@ -40,8 +40,8 @@ VACUUM [ FULL ] [ FREEZE ] [ VERBOSE ] ANALYZE [ <replaceable class="PARAMETER">
4040

4141
<para>
4242
With no parameter, <command>VACUUM</command> processes every table in the
43-
current database. With a parameter, <command>VACUUM</command> processes
44-
only that table.
43+
current database that the current user has permission to vacuum.
44+
With a parameter, <command>VACUUM</command> processesonly that table.
4545
</para>
4646

4747
<para>
@@ -146,6 +146,16 @@ VACUUM [ FULL ] [ FREEZE ] [ VERBOSE ] ANALYZE [ <replaceable class="PARAMETER">
146146
<refsect1>
147147
<title>Notes</title>
148148

149+
<para>
150+
To vacuum a table, one must ordinarily be the table's owner or a
151+
superuser. However, database owners are allowed to
152+
vacuum all tables in their databases, except shared catalogs.
153+
(The restriction for shared catalogs means that a true database-wide
154+
<command>VACUUM</> can only be performed by a superuser.)
155+
<command>VACUUM</> will skip over any tables that the calling user
156+
does not have permission to vacuum.
157+
</para>
158+
149159
<para>
150160
<command>VACUUM</> cannot be executed inside a transaction block.
151161
</para>

‎src/backend/access/transam/varsup.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Copyright (c) 2000-2008, PostgreSQL Global Development Group
77
*
88
* IDENTIFICATION
9-
* $PostgreSQL: pgsql/src/backend/access/transam/varsup.c,v 1.81 2008/01/01 19:45:48 momjian Exp $
9+
* $PostgreSQL: pgsql/src/backend/access/transam/varsup.c,v 1.82 2008/12/11 18:16:18 tgl Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -93,7 +93,7 @@ GetNewTransactionId(bool isSubXact)
9393
(errmsg("database \"%s\" must be vacuumed within %u transactions",
9494
NameStr(ShmemVariableCache->limit_datname),
9595
ShmemVariableCache->xidWrapLimit-xid),
96-
errhint("To avoid a database shutdown, execute afull-database VACUUM in \"%s\".",
96+
errhint("To avoid a database shutdown, execute a database-wide VACUUM in \"%s\".",
9797
NameStr(ShmemVariableCache->limit_datname))));
9898
}
9999

@@ -299,7 +299,7 @@ SetTransactionIdLimit(TransactionId oldest_datfrozenxid,
299299
(errmsg("database \"%s\" must be vacuumed within %u transactions",
300300
NameStr(*oldest_datname),
301301
xidWrapLimit-curXid),
302-
errhint("To avoid a database shutdown, execute afull-database VACUUM in \"%s\".",
302+
errhint("To avoid a database shutdown, execute a database-wide VACUUM in \"%s\".",
303303
NameStr(*oldest_datname))));
304304
}
305305

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp