Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 806091c

Browse files
committed
Remove all references to "xlog" from SQL-callable functions in pg_proc.
Commit f82ec32 renamed the pg_xlog directory to pg_wal. To make things consistent, and because "xlog" is terrible terminology for either "transaction log" or "write-ahead log" rename all SQL-callable functions that contain "xlog" in the name to instead contain "wal". (Note that this may pose an upgrade hazard for some users.) Similarly, rename the xlog_position argument of the functions that create slots to be called wal_position. Discussion: https://www.postgresql.org/message-id/CA+Tgmob=YmA=H3DbW1YuOXnFVgBheRmyDkWcD9M8f=5bGWYEoQ@mail.gmail.com
1 parent 72257f9 commit 806091c

30 files changed

+138
-138
lines changed

contrib/bloom/t/001_wal.pl

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ sub test_index_replay
1616
# Wait for standby to catch up
1717
my $applname = $node_standby->name;
1818
my $caughtup_query =
19-
"SELECT pg_current_xlog_location() <= write_location FROM pg_stat_replication WHERE application_name = '$applname';";
19+
"SELECT pg_current_wal_location() <= write_location FROM pg_stat_replication WHERE application_name = '$applname';";
2020
$node_master->poll_query_until('postgres', $caughtup_query)
2121
or die "Timed out while waiting for standby 1 to catch up";
2222

contrib/test_decoding/expected/ddl.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'test_d
5858
SELECT slot_name, plugin, slot_type, active,
5959
NOT catalog_xmin IS NULL AS catalog_xmin_set,
6060
xmin IS NULl AS data_xmin_not_set,
61-
pg_xlog_location_diff(restart_lsn, '0/01000000') > 0 AS some_wal
61+
pg_wal_location_diff(restart_lsn, '0/01000000') > 0 AS some_wal
6262
FROM pg_replication_slots;
6363
slot_name | plugin | slot_type | active | catalog_xmin_set | data_xmin_not_set | some_wal
6464
-----------------+---------------+-----------+--------+------------------+-------------------+----------

contrib/test_decoding/sql/ddl.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'test_d
2929
SELECT slot_name, plugin, slot_type, active,
3030
NOT catalog_xmin IS NULL AS catalog_xmin_set,
3131
xmin IS NULl AS data_xmin_not_set,
32-
pg_xlog_location_diff(restart_lsn, '0/01000000') > 0 AS some_wal
32+
pg_wal_location_diff(restart_lsn, '0/01000000') > 0 AS some_wal
3333
FROM pg_replication_slots;
3434

3535
/*

doc/src/sgml/backup.sgml

+1-1
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ test ! -f /mnt/server/archivedir/00000001000000A900000065 &amp;&amp; cp pg_wal/0
726726

727727
<para>
728728
Also, you can force a segment switch manually with
729-
<function>pg_switch_xlog</> if you want to ensure that a
729+
<function>pg_switch_wal</> if you want to ensure that a
730730
just-finished transaction is archived as soon as possible. Other utility
731731
functions related to WAL management are listed in <xref
732732
linkend="functions-admin-backup-table">.

doc/src/sgml/func.sgml

+36-36
Original file line numberDiff line numberDiff line change
@@ -17952,13 +17952,13 @@ SELECT set_config('log_statement_stats', 'off', false);
1795217952
<primary>pg_create_restore_point</primary>
1795317953
</indexterm>
1795417954
<indexterm>
17955-
<primary>pg_current_xlog_flush_location</primary>
17955+
<primary>pg_current_wal_flush_location</primary>
1795617956
</indexterm>
1795717957
<indexterm>
17958-
<primary>pg_current_xlog_insert_location</primary>
17958+
<primary>pg_current_wal_insert_location</primary>
1795917959
</indexterm>
1796017960
<indexterm>
17961-
<primary>pg_current_xlog_location</primary>
17961+
<primary>pg_current_wal_location</primary>
1796217962
</indexterm>
1796317963
<indexterm>
1796417964
<primary>pg_start_backup</primary>
@@ -17973,24 +17973,24 @@ SELECT set_config('log_statement_stats', 'off', false);
1797317973
<primary>pg_backup_start_time</primary>
1797417974
</indexterm>
1797517975
<indexterm>
17976-
<primary>pg_switch_xlog</primary>
17976+
<primary>pg_switch_wal</primary>
1797717977
</indexterm>
1797817978
<indexterm>
17979-
<primary>pg_xlogfile_name</primary>
17979+
<primary>pg_walfile_name</primary>
1798017980
</indexterm>
1798117981
<indexterm>
17982-
<primary>pg_xlogfile_name_offset</primary>
17982+
<primary>pg_walfile_name_offset</primary>
1798317983
</indexterm>
1798417984
<indexterm>
17985-
<primary>pg_xlog_location_diff</primary>
17985+
<primary>pg_wal_location_diff</primary>
1798617986
</indexterm>
1798717987

1798817988
<para>
1798917989
The functions shown in <xref
1799017990
linkend="functions-admin-backup-table"> assist in making on-line backups.
1799117991
These functions cannot be executed during recovery (except
1799217992
<function>pg_is_in_backup</function>, <function>pg_backup_start_time</function>
17993-
and <function>pg_xlog_location_diff</function>).
17993+
and <function>pg_wal_location_diff</function>).
1799417994
</para>
1799517995

1799617996
<table id="functions-admin-backup-table">
@@ -18011,21 +18011,21 @@ SELECT set_config('log_statement_stats', 'off', false);
1801118011
</row>
1801218012
<row>
1801318013
<entry>
18014-
<literal><function>pg_current_xlog_flush_location()</function></literal>
18014+
<literal><function>pg_current_wal_flush_location()</function></literal>
1801518015
</entry>
1801618016
<entry><type>pg_lsn</type></entry>
1801718017
<entry>Get current transaction log flush location</entry>
1801818018
</row>
1801918019
<row>
1802018020
<entry>
18021-
<literal><function>pg_current_xlog_insert_location()</function></literal>
18021+
<literal><function>pg_current_wal_insert_location()</function></literal>
1802218022
</entry>
1802318023
<entry><type>pg_lsn</type></entry>
1802418024
<entry>Get current transaction log insert location</entry>
1802518025
</row>
1802618026
<row>
1802718027
<entry>
18028-
<literal><function>pg_current_xlog_location()</function></literal>
18028+
<literal><function>pg_current_wal_location()</function></literal>
1802918029
</entry>
1803018030
<entry><type>pg_lsn</type></entry>
1803118031
<entry>Get current transaction log write location</entry>
@@ -18067,28 +18067,28 @@ SELECT set_config('log_statement_stats', 'off', false);
1806718067
</row>
1806818068
<row>
1806918069
<entry>
18070-
<literal><function>pg_switch_xlog()</function></literal>
18070+
<literal><function>pg_switch_wal()</function></literal>
1807118071
</entry>
1807218072
<entry><type>pg_lsn</type></entry>
1807318073
<entry>Force switch to a new transaction log file (restricted to superusers by default, but other users can be granted EXECUTE to run the function)</entry>
1807418074
</row>
1807518075
<row>
1807618076
<entry>
18077-
<literal><function>pg_xlogfile_name(<parameter>location</> <type>pg_lsn</>)</function></literal>
18077+
<literal><function>pg_walfile_name(<parameter>location</> <type>pg_lsn</>)</function></literal>
1807818078
</entry>
1807918079
<entry><type>text</type></entry>
1808018080
<entry>Convert transaction log location string to file name</entry>
1808118081
</row>
1808218082
<row>
1808318083
<entry>
18084-
<literal><function>pg_xlogfile_name_offset(<parameter>location</> <type>pg_lsn</>)</function></literal>
18084+
<literal><function>pg_walfile_name_offset(<parameter>location</> <type>pg_lsn</>)</function></literal>
1808518085
</entry>
1808618086
<entry><type>text</>, <type>integer</></entry>
1808718087
<entry>Convert transaction log location string to file name and decimal byte offset within file</entry>
1808818088
</row>
1808918089
<row>
1809018090
<entry>
18091-
<literal><function>pg_xlog_location_diff(<parameter>location</> <type>pg_lsn</>, <parameter>location</> <type>pg_lsn</>)</function></literal>
18091+
<literal><function>pg_wal_location_diff(<parameter>location</> <type>pg_lsn</>, <parameter>location</> <type>pg_lsn</>)</function></literal>
1809218092
</entry>
1809318093
<entry><type>numeric</></entry>
1809418094
<entry>Calculate the difference between two transaction log locations</entry>
@@ -18146,11 +18146,11 @@ postgres=# select pg_start_backup('label_goes_here');
1814618146
</para>
1814718147

1814818148
<para>
18149-
<function>pg_switch_xlog</> moves to the next transaction log file, allowing the
18149+
<function>pg_switch_wal</> moves to the next transaction log file, allowing the
1815018150
current file to be archived (assuming you are using continuous archiving).
1815118151
The return value is the ending transaction log location + 1 within the just-completed transaction log file.
1815218152
If there has been no transaction log activity since the last transaction log switch,
18153-
<function>pg_switch_xlog</> does nothing and returns the start location
18153+
<function>pg_switch_wal</> does nothing and returns the start location
1815418154
of the transaction log file currently in use.
1815518155
</para>
1815618156

@@ -18165,10 +18165,10 @@ postgres=# select pg_start_backup('label_goes_here');
1816518165
</para>
1816618166

1816718167
<para>
18168-
<function>pg_current_xlog_location</> displays the current transaction log write
18168+
<function>pg_current_wal_location</> displays the current transaction log write
1816918169
location in the same format used by the above functions. Similarly,
18170-
<function>pg_current_xlog_insert_location</> displays the current transaction log
18171-
insertion point and <function>pg_current_xlog_flush_location</> displays the
18170+
<function>pg_current_wal_insert_location</> displays the current transaction log
18171+
insertion point and <function>pg_current_wal_flush_location</> displays the
1817218172
current transaction log flush point. The insertion point is the <quote>logical</>
1817318173
end of the transaction log at any instant, while the write location is the end of
1817418174
what has actually been written out from the server's internal buffers and flush
@@ -18181,17 +18181,17 @@ postgres=# select pg_start_backup('label_goes_here');
1818118181
</para>
1818218182

1818318183
<para>
18184-
You can use <function>pg_xlogfile_name_offset</> to extract the
18184+
You can use <function>pg_walfile_name_offset</> to extract the
1818518185
corresponding transaction log file name and byte offset from the results of any of the
1818618186
above functions. For example:
1818718187
<programlisting>
18188-
postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
18188+
postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup());
1818918189
file_name | file_offset
1819018190
--------------------------+-------------
1819118191
00000001000000000000000D | 4039624
1819218192
(1 row)
1819318193
</programlisting>
18194-
Similarly, <function>pg_xlogfile_name</> extracts just the transaction log file name.
18194+
Similarly, <function>pg_walfile_name</> extracts just the transaction log file name.
1819518195
When the given transaction log location is exactly at a transaction log file boundary, both
1819618196
these functions return the name of the preceding transaction log file.
1819718197
This is usually the desired behavior for managing transaction log archiving
@@ -18200,7 +18200,7 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
1820018200
</para>
1820118201

1820218202
<para>
18203-
<function>pg_xlog_location_diff</> calculates the difference in bytes
18203+
<function>pg_wal_location_diff</> calculates the difference in bytes
1820418204
between two transaction log locations. It can be used with
1820518205
<structname>pg_stat_replication</structname> or some functions shown in
1820618206
<xref linkend="functions-admin-backup-table"> to get the replication lag.
@@ -18220,10 +18220,10 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
1822018220
<primary>pg_is_in_recovery</primary>
1822118221
</indexterm>
1822218222
<indexterm>
18223-
<primary>pg_last_xlog_receive_location</primary>
18223+
<primary>pg_last_wal_receive_location</primary>
1822418224
</indexterm>
1822518225
<indexterm>
18226-
<primary>pg_last_xlog_replay_location</primary>
18226+
<primary>pg_last_wal_replay_location</primary>
1822718227
</indexterm>
1822818228
<indexterm>
1822918229
<primary>pg_last_xact_replay_timestamp</primary>
@@ -18255,7 +18255,7 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
1825518255
</row>
1825618256
<row>
1825718257
<entry>
18258-
<literal><function>pg_last_xlog_receive_location()</function></literal>
18258+
<literal><function>pg_last_wal_receive_location()</function></literal>
1825918259
</entry>
1826018260
<entry><type>pg_lsn</type></entry>
1826118261
<entry>Get last transaction log location received and synced to disk by
@@ -18269,7 +18269,7 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
1826918269
</row>
1827018270
<row>
1827118271
<entry>
18272-
<literal><function>pg_last_xlog_replay_location()</function></literal>
18272+
<literal><function>pg_last_wal_replay_location()</function></literal>
1827318273
</entry>
1827418274
<entry><type>pg_lsn</type></entry>
1827518275
<entry>Get last transaction log location replayed during recovery.
@@ -18301,13 +18301,13 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
1830118301
</table>
1830218302

1830318303
<indexterm>
18304-
<primary>pg_is_xlog_replay_paused</primary>
18304+
<primary>pg_is_wal_replay_paused</primary>
1830518305
</indexterm>
1830618306
<indexterm>
18307-
<primary>pg_xlog_replay_pause</primary>
18307+
<primary>pg_wal_replay_pause</primary>
1830818308
</indexterm>
1830918309
<indexterm>
18310-
<primary>pg_xlog_replay_resume</primary>
18310+
<primary>pg_wal_replay_resume</primary>
1831118311
</indexterm>
1831218312

1831318313
<para>
@@ -18327,23 +18327,23 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
1832718327
<tbody>
1832818328
<row>
1832918329
<entry>
18330-
<literal><function>pg_is_xlog_replay_paused()</function></literal>
18330+
<literal><function>pg_is_wal_replay_paused()</function></literal>
1833118331
</entry>
1833218332
<entry><type>bool</type></entry>
1833318333
<entry>True if recovery is paused.
1833418334
</entry>
1833518335
</row>
1833618336
<row>
1833718337
<entry>
18338-
<literal><function>pg_xlog_replay_pause()</function></literal>
18338+
<literal><function>pg_wal_replay_pause()</function></literal>
1833918339
</entry>
1834018340
<entry><type>void</type></entry>
1834118341
<entry>Pauses recovery immediately (restricted to superusers by default, but other users can be granted EXECUTE to run the function).
1834218342
</entry>
1834318343
</row>
1834418344
<row>
1834518345
<entry>
18346-
<literal><function>pg_xlog_replay_resume()</function></literal>
18346+
<literal><function>pg_wal_replay_resume()</function></literal>
1834718347
</entry>
1834818348
<entry><type>void</type></entry>
1834918349
<entry>Restarts recovery if it was paused (restricted to superusers by default, but other users can be granted EXECUTE to run the function).
@@ -18492,7 +18492,7 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
1849218492
<literal><function>pg_create_physical_replication_slot(<parameter>slot_name</parameter> <type>name</type> <optional>, <parameter>immediately_reserve</> <type>boolean</>, <parameter>temporary</> <type>boolean</></optional>)</function></literal>
1849318493
</entry>
1849418494
<entry>
18495-
(<parameter>slot_name</parameter> <type>name</type>, <parameter>xlog_position</parameter> <type>pg_lsn</type>)
18495+
(<parameter>slot_name</parameter> <type>name</type>, <parameter>wal_position</parameter> <type>pg_lsn</type>)
1849618496
</entry>
1849718497
<entry>
1849818498
Creates a new physical replication slot named
@@ -18536,7 +18536,7 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
1853618536
<literal><function>pg_create_logical_replication_slot(<parameter>slot_name</parameter> <type>name</type>, <parameter>plugin</parameter> <type>name</type> <optional>, <parameter>temporary</> <type>boolean</></optional>)</function></literal>
1853718537
</entry>
1853818538
<entry>
18539-
(<parameter>slot_name</parameter> <type>name</type>, <parameter>xlog_position</parameter> <type>pg_lsn</type>)
18539+
(<parameter>slot_name</parameter> <type>name</type>, <parameter>wal_position</parameter> <type>pg_lsn</type>)
1854018540
</entry>
1854118541
<entry>
1854218542
Creates a new logical (decoding) replication slot named

doc/src/sgml/high-availability.sgml

+7-7
Original file line numberDiff line numberDiff line change
@@ -853,8 +853,8 @@ primary_conninfo = 'host=192.168.1.50 port=5432 user=foo password=foopass'
853853
standby. You can calculate this lag by comparing the current WAL write
854854
location on the primary with the last WAL location received by the
855855
standby. They can be retrieved using
856-
<function>pg_current_xlog_location</> on the primary and the
857-
<function>pg_last_xlog_receive_location</> on the standby,
856+
<function>pg_current_wal_location</> on the primary and the
857+
<function>pg_last_wal_receive_location</> on the standby,
858858
respectively (see <xref linkend="functions-admin-backup-table"> and
859859
<xref linkend="functions-recovery-info-table"> for details).
860860
The last WAL receive location in the standby is also displayed in the
@@ -865,10 +865,10 @@ primary_conninfo = 'host=192.168.1.50 port=5432 user=foo password=foopass'
865865
You can retrieve a list of WAL sender processes via the
866866
<link linkend="monitoring-stats-views-table">
867867
<literal>pg_stat_replication</></link> view. Large differences between
868-
<function>pg_current_xlog_location</> and <literal>sent_location</> field
868+
<function>pg_current_wal_location</> and <literal>sent_location</> field
869869
might indicate that the master server is under heavy load, while
870870
differences between <literal>sent_location</> and
871-
<function>pg_last_xlog_receive_location</> on the standby might indicate
871+
<function>pg_last_wal_receive_location</> on the standby might indicate
872872
network delay, or that the standby is under heavy load.
873873
</para>
874874
</sect3>
@@ -929,7 +929,7 @@ primary_conninfo = 'host=192.168.1.50 port=5432 user=foo password=foopass'
929929
You can create a replication slot like this:
930930
<programlisting>
931931
postgres=# SELECT * FROM pg_create_physical_replication_slot('node_a_slot');
932-
slot_name | xlog_position
932+
slot_name | wal_position
933933
-------------+---------------
934934
node_a_slot |
935935

@@ -1587,7 +1587,7 @@ if (!triggered)
15871587
</para>
15881588

15891589
<para>
1590-
An external program can call the <function>pg_xlogfile_name_offset()</>
1590+
An external program can call the <function>pg_walfile_name_offset()</>
15911591
function (see <xref linkend="functions-admin">)
15921592
to find out the file name and the exact byte offset within it of
15931593
the current end of WAL. It can then access the WAL file directly
@@ -2225,7 +2225,7 @@ LOG: database system is ready to accept read only connections
22252225

22262226
<para>
22272227
WAL file control commands will not work during recovery,
2228-
e.g. <function>pg_start_backup</>, <function>pg_switch_xlog</> etc.
2228+
e.g. <function>pg_start_backup</>, <function>pg_switch_wal</> etc.
22292229
</para>
22302230

22312231
<para>

doc/src/sgml/logicaldecoding.sgml

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
<programlisting>
5757
postgres=# -- Create a slot named 'regression_slot' using the output plugin 'test_decoding'
5858
postgres=# SELECT * FROM pg_create_logical_replication_slot('regression_slot', 'test_decoding');
59-
slot_name | xlog_position
59+
slot_name | wal_position
6060
-----------------+---------------
6161
regression_slot | 0/16B1970
6262
(1 row)

doc/src/sgml/recovery-config.sgml

+1-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"' # Windows
321321
to be executed against the database to check if this recovery target
322322
is the most desirable point for recovery.
323323
The paused state can be resumed by
324-
using <function>pg_xlog_replay_resume()</> (see
324+
using <function>pg_wal_replay_resume()</> (see
325325
<xref linkend="functions-recovery-control-table">), which then
326326
causes recovery to end. If this recovery target is not the
327327
desired stopping point, then shut down the server, change the

src/backend/access/transam/recovery.conf.sample

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
#
9999
# If recovery_target_action = 'pause', recovery will pause when the
100100
# recovery target is reached. The pause state will continue until
101-
# pg_xlog_replay_resume() is called. This setting has no effect if
101+
# pg_wal_replay_resume() is called. This setting has no effect if
102102
# no recovery target is set. If hot_standby is not enabled then the
103103
# server will shutdown instead, though you may request this in
104104
# any case by specifying 'shutdown'.

src/backend/access/transam/xlog.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -5870,7 +5870,7 @@ recoveryPausesHere(void)
58705870

58715871
ereport(LOG,
58725872
(errmsg("recovery has paused"),
5873-
errhint("Execute pg_xlog_replay_resume() to continue.")));
5873+
errhint("Execute pg_wal_replay_resume() to continue.")));
58745874

58755875
while (RecoveryIsPaused())
58765876
{

0 commit comments

Comments
 (0)