Skip to content

Commit 88e66d1

Browse files
committed
Rename "pg_clog" directory to "pg_xact".
Names containing the letters "log" sometimes confuse users into believing that only non-critical data is present. It is hoped this renaming will discourage ill-considered removals of transaction status data. Michael Paquier Discussion: http://postgr.es/m/CA+Tgmoa9xFQyjRZupbdEFuwUerFTvC6HjZq1ud6GYragGDFFgA@mail.gmail.com
1 parent bd9028b commit 88e66d1

File tree

28 files changed

+84
-73
lines changed

28 files changed

+84
-73
lines changed

doc/src/sgml/backup.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,10 +382,10 @@ tar -cf backup.tar /usr/local/pgsql/data
382382
directories. This will <emphasis>not</> work because the
383383
information contained in these files is not usable without
384384
the commit log files,
385-
<filename>pg_clog/*</filename>, which contain the commit status of
385+
<filename>pg_xact/*</filename>, which contain the commit status of
386386
all transactions. A table file is only usable with this
387387
information. Of course it is also impossible to restore only a
388-
table and the associated <filename>pg_clog</filename> data
388+
table and the associated <filename>pg_xact</filename> data
389389
because that would render all other tables in the database
390390
cluster useless. So file system backups only work for complete
391391
backup and restoration of an entire database cluster.

doc/src/sgml/catalogs.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1893,7 +1893,7 @@
18931893
All transaction IDs before this one have been replaced with a permanent
18941894
(<quote>frozen</>) transaction ID in this table. This is used to track
18951895
whether the table needs to be vacuumed in order to prevent transaction
1896-
ID wraparound or to allow <literal>pg_clog</> to be shrunk. Zero
1896+
ID wraparound or to allow <literal>pg_xact</> to be shrunk. Zero
18971897
(<symbol>InvalidTransactionId</symbol>) if the relation is not a table.
18981898
</entry>
18991899
</row>
@@ -2570,7 +2570,7 @@
25702570
All transaction IDs before this one have been replaced with a permanent
25712571
(<quote>frozen</>) transaction ID in this database. This is used to
25722572
track whether the database needs to be vacuumed in order to prevent
2573-
transaction ID wraparound or to allow <literal>pg_clog</> to be shrunk.
2573+
transaction ID wraparound or to allow <literal>pg_xact</> to be shrunk.
25742574
It is the minimum of the per-table
25752575
<structname>pg_class</>.<structfield>relfrozenxid</> values.
25762576
</entry>

doc/src/sgml/config.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6004,7 +6004,7 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
60046004

60056005
<para>
60066006
Vacuum also allows removal of old files from the
6007-
<filename>pg_clog</> subdirectory, which is why the default
6007+
<filename>pg_xact</> subdirectory, which is why the default
60086008
is a relatively low 200 million transactions.
60096009
This parameter can only be set at server start, but the setting
60106010
can be reduced for individual tables by

doc/src/sgml/func.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15616,7 +15616,7 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n);
1561615616
postmaster.pid | 9
1561715617
pg_ident.conf | 10
1561815618
global | 11
15619-
pg_clog | 12
15619+
pg_xact | 12
1562015620
pg_snapshots | 13
1562115621
pg_multixact | 14
1562215622
PG_VERSION | 15

doc/src/sgml/maintenance.sgml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -527,18 +527,18 @@
527527
<para>
528528
The sole disadvantage of increasing <varname>autovacuum_freeze_max_age</>
529529
(and <varname>vacuum_freeze_table_age</> along with it)
530-
is that the <filename>pg_clog</> subdirectory of the database cluster
530+
is that the <filename>pg_xact</> subdirectory of the database cluster
531531
will take more space, because it must store the commit status of all
532532
transactions back to the <varname>autovacuum_freeze_max_age</> horizon.
533533
The commit status uses two bits per transaction, so if
534534
<varname>autovacuum_freeze_max_age</> is set to its maximum allowed
535-
value of two billion, <filename>pg_clog</> can be expected to
535+
value of two billion, <filename>pg_xact</> can be expected to
536536
grow to about half a gigabyte. If this is trivial compared to your
537537
total database size, setting <varname>autovacuum_freeze_max_age</> to
538538
its maximum allowed value is recommended. Otherwise, set it depending
539-
on what you are willing to allow for <filename>pg_clog</> storage.
539+
on what you are willing to allow for <filename>pg_xact</> storage.
540540
(The default, 200 million transactions, translates to about 50MB of
541-
<filename>pg_clog</> storage.)
541+
<filename>pg_xact</> storage.)
542542
</para>
543543

544544
<para>

doc/src/sgml/ref/pg_resetwal.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,12 @@ PostgreSQL documentation
256256

257257
<para>
258258
A safe value can be determined by looking for the numerically largest
259-
file name in the directory <filename>pg_clog</> under the data directory,
259+
file name in the directory <filename>pg_xact</> under the data directory,
260260
adding one,
261261
and then multiplying by 1048576 (0x100000). Note that the file names are in
262262
hexadecimal. It is usually easiest to specify the option value in
263263
hexadecimal too. For example, if <filename>0011</> is the largest entry
264-
in <filename>pg_clog</>, <literal>-x 0x1200000</> will work (five
264+
in <filename>pg_xact</>, <literal>-x 0x1200000</> will work (five
265265
trailing zeroes provide the proper multiplier).
266266
</para>
267267
</listitem>

doc/src/sgml/ref/pg_rewind.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ PostgreSQL documentation
229229
</step>
230230
<step>
231231
<para>
232-
Copy all other files such as <filename>pg_clog</filename> and
232+
Copy all other files such as <filename>pg_xact</filename> and
233233
configuration files from the source cluster to the target cluster
234234
(everything except the relation files).
235235
</para>

doc/src/sgml/storage.sgml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,6 @@ Item
7777
<entry>Subdirectory containing transaction commit timestamp data</entry>
7878
</row>
7979

80-
<row>
81-
<entry><filename>pg_clog</></entry>
82-
<entry>Subdirectory containing transaction commit status data</entry>
83-
</row>
84-
8580
<row>
8681
<entry><filename>pg_dynshmem</></entry>
8782
<entry>Subdirectory containing files used by the dynamic shared memory
@@ -151,6 +146,11 @@ Item
151146
<entry>Subdirectory containing WAL (Write Ahead Log) files</entry>
152147
</row>
153148

149+
<row>
150+
<entry><filename>pg_xact</></entry>
151+
<entry>Subdirectory containing transaction commit status data</entry>
152+
</row>
153+
154154
<row>
155155
<entry><filename>postgresql.auto.conf</></entry>
156156
<entry>A file used for storing configuration parameters that are set by

doc/src/sgml/wal.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
</listitem>
202202
<listitem>
203203
<para>
204-
Internal data structures such as <filename>pg_clog</filename>, <filename>pg_subtrans</filename>, <filename>pg_multixact</filename>,
204+
Internal data structures such as <filename>pg_xact</filename>, <filename>pg_subtrans</filename>, <filename>pg_multixact</filename>,
205205
<filename>pg_serial</filename>, <filename>pg_notify</filename>, <filename>pg_stat</filename>, <filename>pg_snapshots</filename> are not directly
206206
checksummed, nor are pages protected by full page writes. However, where
207207
such data structures are persistent, WAL records are written that allow

src/backend/access/heap/heapam.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6790,8 +6790,8 @@ heap_prepare_freeze_tuple(HeapTupleHeader tuple, TransactionId cutoff_xid,
67906790
* Note: it might seem we could make the changes without exclusive lock, since
67916791
* TransactionId read/write is assumed atomic anyway. However there is a race
67926792
* condition: someone who just fetched an old XID that we overwrite here could
6793-
* conceivably not finish checking the XID against pg_clog before we finish
6794-
* the VACUUM and perhaps truncate off the part of pg_clog he needs. Getting
6793+
* conceivably not finish checking the XID against pg_xact before we finish
6794+
* the VACUUM and perhaps truncate off the part of pg_xact he needs. Getting
67956795
* exclusive lock ensures no other backend is in process of checking the
67966796
* tuple status. Also, getting exclusive lock makes it safe to adjust the
67976797
* infomask bits.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy