On Tue, Jan 10, 2017 at 5:24 AM, Michael Paquier <michael.paqu...@gmail.com> wrote:
> - errhint("pg_xlogfile_name_offset() cannot be executed > during recovery."))); > + errhint( > + "pg_wal_file_name_offset() cannot be executed > during recovery."))); > I am not sure that there is any need to reformat this error hint. > > Your patch includes useless diff noise in pg_proc.h. By that I mean > the lines of pg_start_backup, pg_stop_backup, etc. > > +/* Next OID: 6016 */ > + > I don't think you need that. > Reverted all of above. > > src/test/perl/PostgresNode.pm has added recently a new method called > lsn() that uses some of the WAL position functions. Their update is > necessary as well for this patch. > Good catch. Changed those as well. > As there are two school of thoughts on this thread, keeping your patch > with the compatibility table is the best move for now. Even if we end > up by having a version without aliases, that will be just code to > remove in the final version. > Indeed, it is trivial to kill aliases. New version of the patch attached. -- Vladimir Rusinov Storage SRE, Google Ireland Google Ireland Ltd.,Gordon House, Barrow Street, Dublin 4, Ireland Registered in Dublin, Ireland Registration Number: 368047
diff --git a/contrib/bloom/t/001_wal.pl b/contrib/bloom/t/001_wal.pl index 56c6618d3d..dc907baf87 100644 --- a/contrib/bloom/t/001_wal.pl +++ b/contrib/bloom/t/001_wal.pl @@ -16,7 +16,7 @@ sub test_index_replay # Wait for standby to catch up my $applname = $node_standby->name; my $caughtup_query = -"SELECT pg_current_xlog_location() <= write_location FROM pg_stat_replication WHERE application_name = '$applname';"; +"SELECT pg_current_wal_location() <= write_location FROM pg_stat_replication WHERE application_name = '$applname';"; $node_master->poll_query_until('postgres', $caughtup_query) or die "Timed out while waiting for standby 1 to catch up"; diff --git a/contrib/test_decoding/expected/ddl.out b/contrib/test_decoding/expected/ddl.out index c104c4802d..275c84a450 100644 --- a/contrib/test_decoding/expected/ddl.out +++ b/contrib/test_decoding/expected/ddl.out @@ -58,7 +58,7 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'test_d SELECT slot_name, plugin, slot_type, active, NOT catalog_xmin IS NULL AS catalog_xmin_set, xmin IS NULl AS data_xmin_not_set, - pg_xlog_location_diff(restart_lsn, '0/01000000') > 0 AS some_wal + pg_wal_location_diff(restart_lsn, '0/01000000') > 0 AS some_wal FROM pg_replication_slots; slot_name | plugin | slot_type | active | catalog_xmin_set | data_xmin_not_set | some_wal -----------------+---------------+-----------+--------+------------------+-------------------+---------- diff --git a/contrib/test_decoding/sql/ddl.sql b/contrib/test_decoding/sql/ddl.sql index 89b8b8f780..49dad39b50 100644 --- a/contrib/test_decoding/sql/ddl.sql +++ b/contrib/test_decoding/sql/ddl.sql @@ -29,7 +29,7 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'test_d SELECT slot_name, plugin, slot_type, active, NOT catalog_xmin IS NULL AS catalog_xmin_set, xmin IS NULl AS data_xmin_not_set, - pg_xlog_location_diff(restart_lsn, '0/01000000') > 0 AS some_wal + pg_wal_location_diff(restart_lsn, '0/01000000') > 0 AS some_wal FROM pg_replication_slots; /* diff --git a/doc/src/sgml/backup.sgml b/doc/src/sgml/backup.sgml index 6eaed1efbe..e37f101277 100644 --- a/doc/src/sgml/backup.sgml +++ b/doc/src/sgml/backup.sgml @@ -726,9 +726,9 @@ test ! -f /mnt/server/archivedir/00000001000000A900000065 && cp pg_wal/0 <para> Also, you can force a segment switch manually with - <function>pg_switch_xlog</> if you want to ensure that a - just-finished transaction is archived as soon as possible. Other utility - functions related to WAL management are listed in <xref + <function>pg_switch_wal</> if you want to ensure that a just-finished + transaction is archived as soon as possible. Other utility functions + related to WAL management are listed in <xref linkend="functions-admin-backup-table">. </para> diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 10e31868ba..a5bfb4b306 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -17925,13 +17925,13 @@ SELECT set_config('log_statement_stats', 'off', false); <primary>pg_create_restore_point</primary> </indexterm> <indexterm> - <primary>pg_current_xlog_flush_location</primary> + <primary>pg_current_wal_flush_location</primary> </indexterm> <indexterm> - <primary>pg_current_xlog_insert_location</primary> + <primary>pg_current_wal_insert_location</primary> </indexterm> <indexterm> - <primary>pg_current_xlog_location</primary> + <primary>pg_current_wal_location</primary> </indexterm> <indexterm> <primary>pg_start_backup</primary> @@ -17946,24 +17946,25 @@ SELECT set_config('log_statement_stats', 'off', false); <primary>pg_backup_start_time</primary> </indexterm> <indexterm> - <primary>pg_switch_xlog</primary> + <primary>pg_switch_wal</primary> </indexterm> <indexterm> - <primary>pg_xlogfile_name</primary> + <primary>pg_wal_file_name</primary> </indexterm> <indexterm> - <primary>pg_xlogfile_name_offset</primary> + <primary>pg_wal_file_name_offset</primary> </indexterm> <indexterm> - <primary>pg_xlog_location_diff</primary> + <primary>pg_wal_location_diff</primary> </indexterm> <para> The functions shown in <xref linkend="functions-admin-backup-table"> assist in making on-line backups. These functions cannot be executed during recovery (except - <function>pg_is_in_backup</function>, <function>pg_backup_start_time</function> - and <function>pg_xlog_location_diff</function>). + <function>pg_is_in_backup</function>, + <function>pg_backup_start_time</function> and + <function>pg_wal_location_diff</function>). </para> <table id="functions-admin-backup-table"> @@ -17984,21 +17985,21 @@ SELECT set_config('log_statement_stats', 'off', false); </row> <row> <entry> - <literal><function>pg_current_xlog_flush_location()</function></literal> + <literal><function>pg_current_wal_flush_location()</function></literal> </entry> <entry><type>pg_lsn</type></entry> <entry>Get current transaction log flush location</entry> </row> <row> <entry> - <literal><function>pg_current_xlog_insert_location()</function></literal> + <literal><function>pg_current_wal_insert_location()</function></literal> </entry> <entry><type>pg_lsn</type></entry> <entry>Get current transaction log insert location</entry> </row> <row> <entry> - <literal><function>pg_current_xlog_location()</function></literal> + <literal><function>pg_current_wal_location()</function></literal> </entry> <entry><type>pg_lsn</type></entry> <entry>Get current transaction log write location</entry> @@ -18040,28 +18041,28 @@ SELECT set_config('log_statement_stats', 'off', false); </row> <row> <entry> - <literal><function>pg_switch_xlog()</function></literal> + <literal><function>pg_switch_wal()</function></literal> </entry> <entry><type>pg_lsn</type></entry> <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> </row> <row> <entry> - <literal><function>pg_xlogfile_name(<parameter>location</> <type>pg_lsn</>)</function></literal> + <literal><function>pg_wal_file_name(<parameter>location</> <type>pg_lsn</>)</function></literal> </entry> <entry><type>text</type></entry> <entry>Convert transaction log location string to file name</entry> </row> <row> <entry> - <literal><function>pg_xlogfile_name_offset(<parameter>location</> <type>pg_lsn</>)</function></literal> + <literal><function>pg_wal_file_name_offset(<parameter>location</> <type>pg_lsn</>)</function></literal> </entry> <entry><type>text</>, <type>integer</></entry> <entry>Convert transaction log location string to file name and decimal byte offset within file</entry> </row> <row> <entry> - <literal><function>pg_xlog_location_diff(<parameter>location</> <type>pg_lsn</>, <parameter>location</> <type>pg_lsn</>)</function></literal> + <literal><function>pg_wal_location_diff(<parameter>location</> <type>pg_lsn</>, <parameter>location</> <type>pg_lsn</>)</function></literal> </entry> <entry><type>numeric</></entry> <entry>Calculate the difference between two transaction log locations</entry> @@ -18119,11 +18120,11 @@ postgres=# select pg_start_backup('label_goes_here'); </para> <para> - <function>pg_switch_xlog</> moves to the next transaction log file, allowing the + <function>pg_switch_wal</> moves to the next transaction log file, allowing the current file to be archived (assuming you are using continuous archiving). The return value is the ending transaction log location + 1 within the just-completed transaction log file. If there has been no transaction log activity since the last transaction log switch, - <function>pg_switch_xlog</> does nothing and returns the start location + <function>pg_switch_wal</> does nothing and returns the start location of the transaction log file currently in use. </para> @@ -18138,10 +18139,10 @@ postgres=# select pg_start_backup('label_goes_here'); </para> <para> - <function>pg_current_xlog_location</> displays the current transaction log write + <function>pg_current_wal_location</> displays the current transaction log write location in the same format used by the above functions. Similarly, - <function>pg_current_xlog_insert_location</> displays the current transaction log - insertion point and <function>pg_current_xlog_flush_location</> displays the + <function>pg_current_wal_insert_location</> displays the current transaction log + insertion point and <function>pg_current_wal_flush_location</> displays the current transaction log flush point. The insertion point is the <quote>logical</> end of the transaction log at any instant, while the write location is the end of what has actually been written out from the server's internal buffers and flush @@ -18154,17 +18155,17 @@ postgres=# select pg_start_backup('label_goes_here'); </para> <para> - You can use <function>pg_xlogfile_name_offset</> to extract the + You can use <function>pg_wal_file_name_offset</> to extract the corresponding transaction log file name and byte offset from the results of any of the above functions. For example: <programlisting> -postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup()); +postgres=# SELECT * FROM pg_wal_file_name_offset(pg_stop_backup()); file_name | file_offset --------------------------+------------- 00000001000000000000000D | 4039624 (1 row) </programlisting> - Similarly, <function>pg_xlogfile_name</> extracts just the transaction log file name. + Similarly, <function>pg_wal_file_name</> extracts just the transaction log file name. When the given transaction log location is exactly at a transaction log file boundary, both these functions return the name of the preceding transaction log file. This is usually the desired behavior for managing transaction log archiving @@ -18173,7 +18174,7 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup()); </para> <para> - <function>pg_xlog_location_diff</> calculates the difference in bytes + <function>pg_wal_location_diff</> calculates the difference in bytes between two transaction log locations. It can be used with <structname>pg_stat_replication</structname> or some functions shown in <xref linkend="functions-admin-backup-table"> to get the replication lag. @@ -18193,10 +18194,10 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup()); <primary>pg_is_in_recovery</primary> </indexterm> <indexterm> - <primary>pg_last_xlog_receive_location</primary> + <primary>pg_last_wal_receive_location</primary> </indexterm> <indexterm> - <primary>pg_last_xlog_replay_location</primary> + <primary>pg_last_wal_replay_location</primary> </indexterm> <indexterm> <primary>pg_last_xact_replay_timestamp</primary> @@ -18228,7 +18229,7 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup()); </row> <row> <entry> - <literal><function>pg_last_xlog_receive_location()</function></literal> + <literal><function>pg_last_wal_receive_location()</function></literal> </entry> <entry><type>pg_lsn</type></entry> <entry>Get last transaction log location received and synced to disk by @@ -18242,7 +18243,7 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup()); </row> <row> <entry> - <literal><function>pg_last_xlog_replay_location()</function></literal> + <literal><function>pg_last_wal_replay_location()</function></literal> </entry> <entry><type>pg_lsn</type></entry> <entry>Get last transaction log location replayed during recovery. @@ -18274,13 +18275,13 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup()); </table> <indexterm> - <primary>pg_is_xlog_replay_paused</primary> + <primary>pg_is_recovery_paused</primary> </indexterm> <indexterm> - <primary>pg_xlog_replay_pause</primary> + <primary>pg_wal_replay_pause</primary> </indexterm> <indexterm> - <primary>pg_xlog_replay_resume</primary> + <primary>pg_wal_replay_resume</primary> </indexterm> <para> @@ -18300,7 +18301,7 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup()); <tbody> <row> <entry> - <literal><function>pg_is_xlog_replay_paused()</function></literal> + <literal><function>pg_is_recovery_paused()</function></literal> </entry> <entry><type>bool</type></entry> <entry>True if recovery is paused. @@ -18308,7 +18309,7 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup()); </row> <row> <entry> - <literal><function>pg_xlog_replay_pause()</function></literal> + <literal><function>pg_wal_replay_pause()</function></literal> </entry> <entry><type>void</type></entry> <entry>Pauses recovery immediately (restricted to superusers by default, but other users can be granted EXECUTE to run the function). @@ -18316,7 +18317,7 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup()); </row> <row> <entry> - <literal><function>pg_xlog_replay_resume()</function></literal> + <literal><function>pg_wal_replay_resume()</function></literal> </entry> <entry><type>void</type></entry> <entry>Restarts recovery if it was paused (restricted to superusers by default, but other users can be granted EXECUTE to run the function). @@ -19670,6 +19671,160 @@ SELECT (pg_stat_file('filename')).modification; </sect2> + + <sect2 id="functions-admin-deprecated"> + <title>Deprecated Functions</title> + + <indexterm> + <primary>pg_current_xlog_flush_location</primary> + </indexterm> + <indexterm> + <primary>pg_current_xlog_insert_location</primary> + </indexterm> + <indexterm> + <primary>pg_current_xlog_location</primary> + </indexterm> + <indexterm> + <primary>pg_is_xlog_replay_paused</primary> + </indexterm> + <indexterm> + <primary>pg_last_xlog_receive_location</primary> + </indexterm> + <indexterm> + <primary>pg_last_xlog_replay_location</primary> + </indexterm> + <indexterm> + <primary>pg_switch_xlog</primary> + </indexterm> + <indexterm> + <primary>pg_xlog_replay_pause</primary> + </indexterm> + <indexterm> + <primary>pg_xlog_location_diff</primary> + </indexterm> + <indexterm> + <primary>pg_xlog_replay_resume</primary> + </indexterm> + <indexterm> + <primary>pg_xlogfile_name</primary> + </indexterm> + <indexterm> + <primary>pg_xlogfile_name_offset</primary> + </indexterm> + + <para> + The functions shown in <xref linkend="functions-admin-deprecated-table"> are + deprecated and will be removed in a future PostgreSQL release. It is highly + recommended to use new function names instead. + </para> + + <table id="functions-admin-deprecated-table"> + <title>Deprecated Administration Functions</title> + <tgroup cols="2"> + <thead><row><entry>Name</entry> <entry>Replaced by</entry></row></thead> + <tbody> + <row> + <entry> + <literal><function>pg_current_xlog_flush_location</function></literal> + </entry> + <entry> + <literal><function>pg_current_wal_flush_location</function></literal> + </entry> + </row> + <row> + <entry> + <literal><function>pg_current_xlog_insert_location</function></literal> + </entry> + <entry> + <literal><function>pg_current_wal_insert_location</function></literal> + </entry> + </row> + <row> + <entry> + <literal><function>pg_current_xlog_location</function></literal> + </entry> + <entry> + <literal><function>pg_current_wal_location</function></literal> + </entry> + </row> + <row> + <entry> + <literal><function>pg_is_xlog_replay_paused</function></literal> + </entry> + <entry> + <literal><function>pg_is_recovery_paused</function></literal> + </entry> + </row> + <row> + <entry> + <literal><function>pg_last_xlog_receive_location</function></literal> + </entry> + <entry> + <literal><function>pg_last_wal_receive_location</function></literal> + </entry> + </row> + <row> + <entry> + <literal><function>pg_last_xlog_replay_location</function></literal> + </entry> + <entry> + <literal><function>pg_last_wal_replay_location</function></literal> + </entry> + </row> + <row> + <entry> + <literal><function>pg_switch_xlog</function></literal> + </entry> + <entry> + <literal><function>pg_switch_wal</function></literal> + </entry> + </row> + <row> + <entry> + <literal><function>pg_xlog_location_diff</function></literal> + </entry> + <entry> + <literal><function>pg_wal_location_diff</function></literal> + </entry> + </row> + <row> + <entry> + <literal><function>pg_xlog_replay_pause</function></literal> + </entry> + <entry> + <literal><function>pg_wal_replay_pause</function></literal> + </entry> + </row> + <row> + <entry> + <literal><function>pg_xlog_replay_resume</function></literal> + </entry> + <entry> + <literal><function>pg_wal_replay_resume</function></literal> + </entry> + </row> + <row> + <entry> + <literal><function>pg_xlogfile_name</function></literal> + </entry> + <entry> + <literal><function>pg_wal_file_name</function></literal> + </entry> + </row> + <row> + <entry> + <literal><function>pg_xlogfile_name_offset</function></literal> + </entry> + <entry> + <literal><function>pg_wal_file_name_offset</function></literal> + </entry> + </row> + </tbody> + </tgroup> + </table> + + </sect2> + </sect1> <sect1 id="functions-trigger"> diff --git a/doc/src/sgml/high-availability.sgml b/doc/src/sgml/high-availability.sgml index a1a9532088..e1c08c6e94 100644 --- a/doc/src/sgml/high-availability.sgml +++ b/doc/src/sgml/high-availability.sgml @@ -853,8 +853,8 @@ primary_conninfo = 'host=192.168.1.50 port=5432 user=foo password=foopass' standby. You can calculate this lag by comparing the current WAL write location on the primary with the last WAL location received by the standby. They can be retrieved using - <function>pg_current_xlog_location</> on the primary and the - <function>pg_last_xlog_receive_location</> on the standby, + <function>pg_current_wal_location</> on the primary and the + <function>pg_last_wal_receive_location</> on the standby, respectively (see <xref linkend="functions-admin-backup-table"> and <xref linkend="functions-recovery-info-table"> for details). 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' You can retrieve a list of WAL sender processes via the <link linkend="monitoring-stats-views-table"> <literal>pg_stat_replication</></link> view. Large differences between - <function>pg_current_xlog_location</> and <literal>sent_location</> field + <function>pg_current_wal_location</> and <literal>sent_location</> field might indicate that the master server is under heavy load, while differences between <literal>sent_location</> and - <function>pg_last_xlog_receive_location</> on the standby might indicate + <function>pg_last_wal_receive_location</> on the standby might indicate network delay, or that the standby is under heavy load. </para> </sect3> @@ -1587,7 +1587,7 @@ if (!triggered) </para> <para> - An external program can call the <function>pg_xlogfile_name_offset()</> + An external program can call the <function>pg_wal_file_name_offset()</> function (see <xref linkend="functions-admin">) to find out the file name and the exact byte offset within it of 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 <para> WAL file control commands will not work during recovery, - e.g. <function>pg_start_backup</>, <function>pg_switch_xlog</> etc. + e.g. <function>pg_start_backup</>, <function>pg_switch_wal</> etc. </para> <para> diff --git a/doc/src/sgml/recovery-config.sgml b/doc/src/sgml/recovery-config.sgml index 8c24ae2174..a91864bf62 100644 --- a/doc/src/sgml/recovery-config.sgml +++ b/doc/src/sgml/recovery-config.sgml @@ -321,7 +321,7 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"' # Windows to be executed against the database to check if this recovery target is the most desirable point for recovery. The paused state can be resumed by - using <function>pg_xlog_replay_resume()</> (see + using <function>pg_wal_replay_resume()</> (see <xref linkend="functions-recovery-control-table">), which then causes recovery to end. If this recovery target is not the desired stopping point, then shut down the server, change the diff --git a/src/backend/access/transam/recovery.conf.sample b/src/backend/access/transam/recovery.conf.sample index 7a16751541..ace77df728 100644 --- a/src/backend/access/transam/recovery.conf.sample +++ b/src/backend/access/transam/recovery.conf.sample @@ -98,10 +98,9 @@ # # If recovery_target_action = 'pause', recovery will pause when the # recovery target is reached. The pause state will continue until -# pg_xlog_replay_resume() is called. This setting has no effect if -# no recovery target is set. If hot_standby is not enabled then the -# server will shutdown instead, though you may request this in -# any case by specifying 'shutdown'. +# pg_wal_replay_resume() is called. This setting has no effect if no recovery +# target is set. If hot_standby is not enabled then the server will shutdown +# instead, though you may request this in any case by specifying 'shutdown'. # #recovery_target_action = 'pause' # diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 70edafadff..6dd63a945f 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -5740,7 +5740,7 @@ recoveryPausesHere(void) ereport(LOG, (errmsg("recovery has paused"), - errhint("Execute pg_xlog_replay_resume() to continue."))); + errhint("Execute pg_wal_replay_resume() to continue."))); while (RecoveryIsPaused()) { diff --git a/src/backend/access/transam/xlogfuncs.c b/src/backend/access/transam/xlogfuncs.c index 5cafb8b913..e5ac9272d0 100644 --- a/src/backend/access/transam/xlogfuncs.c +++ b/src/backend/access/transam/xlogfuncs.c @@ -277,13 +277,13 @@ pg_stop_backup_v2(PG_FUNCTION_ARGS) } /* - * pg_switch_xlog: switch to next xlog file + * pg_switch_wal: switch to next WAL file * * Permission checking for this function is managed through the normal * GRANT system. */ Datum -pg_switch_xlog(PG_FUNCTION_ARGS) +pg_switch_wal(PG_FUNCTION_ARGS) { XLogRecPtr switchpoint; @@ -349,7 +349,7 @@ pg_create_restore_point(PG_FUNCTION_ARGS) * to the kernel, but is not necessarily synced to disk. */ Datum -pg_current_xlog_location(PG_FUNCTION_ARGS) +pg_current_wal_location(PG_FUNCTION_ARGS) { XLogRecPtr current_recptr; @@ -370,7 +370,7 @@ pg_current_xlog_location(PG_FUNCTION_ARGS) * This function is mostly for debugging purposes. */ Datum -pg_current_xlog_insert_location(PG_FUNCTION_ARGS) +pg_current_wal_insert_location(PG_FUNCTION_ARGS) { XLogRecPtr current_recptr; @@ -391,7 +391,7 @@ pg_current_xlog_insert_location(PG_FUNCTION_ARGS) * This function is mostly for debugging purposes. */ Datum -pg_current_xlog_flush_location(PG_FUNCTION_ARGS) +pg_current_wal_flush_location(PG_FUNCTION_ARGS) { XLogRecPtr current_recptr; @@ -413,7 +413,7 @@ pg_current_xlog_flush_location(PG_FUNCTION_ARGS) * and synced to disk by walreceiver. */ Datum -pg_last_xlog_receive_location(PG_FUNCTION_ARGS) +pg_last_wal_receive_location(PG_FUNCTION_ARGS) { XLogRecPtr recptr; @@ -432,7 +432,7 @@ pg_last_xlog_receive_location(PG_FUNCTION_ARGS) * connections during recovery. */ Datum -pg_last_xlog_replay_location(PG_FUNCTION_ARGS) +pg_last_wal_replay_location(PG_FUNCTION_ARGS) { XLogRecPtr recptr; @@ -445,15 +445,15 @@ pg_last_xlog_replay_location(PG_FUNCTION_ARGS) } /* - * Compute an xlog file name and decimal byte offset given a WAL location, - * such as is returned by pg_stop_backup() or pg_xlog_switch(). + * Compute an WAL file name and decimal byte offset given a WAL location, + * such as is returned by pg_stop_backup() or pg_switch_wal(). * * Note that a location exactly at a segment boundary is taken to be in * the previous segment. This is usually the right thing, since the * expected usage is to determine which xlog file(s) are ready to archive. */ Datum -pg_xlogfile_name_offset(PG_FUNCTION_ARGS) +pg_wal_file_name_offset(PG_FUNCTION_ARGS) { XLogSegNo xlogsegno; uint32 xrecoff; @@ -469,7 +469,7 @@ pg_xlogfile_name_offset(PG_FUNCTION_ARGS) ereport(ERROR, (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), errmsg("recovery is in progress"), - errhint("pg_xlogfile_name_offset() cannot be executed during recovery."))); + errhint("pg_wal_file_name_offset() cannot be executed during recovery."))); /* * Construct a tuple descriptor for the result row. This must match this @@ -512,10 +512,10 @@ pg_xlogfile_name_offset(PG_FUNCTION_ARGS) /* * Compute an xlog file name given a WAL location, - * such as is returned by pg_stop_backup() or pg_xlog_switch(). + * such as is returned by pg_stop_backup() or pg_switch_wal(). */ Datum -pg_xlogfile_name(PG_FUNCTION_ARGS) +pg_wal_file_name(PG_FUNCTION_ARGS) { XLogSegNo xlogsegno; XLogRecPtr locationpoint = PG_GETARG_LSN(0); @@ -525,7 +525,7 @@ pg_xlogfile_name(PG_FUNCTION_ARGS) ereport(ERROR, (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), errmsg("recovery is in progress"), - errhint("pg_xlogfile_name() cannot be executed during recovery."))); + errhint("pg_wal_file_name() cannot be executed during recovery."))); XLByteToPrevSeg(locationpoint, xlogsegno); XLogFileName(xlogfilename, ThisTimeLineID, xlogsegno); @@ -534,13 +534,13 @@ pg_xlogfile_name(PG_FUNCTION_ARGS) } /* - * pg_xlog_replay_pause - pause recovery now + * pg_wal_replay_pause - pause recovery now * * Permission checking for this function is managed through the normal * GRANT system. */ Datum -pg_xlog_replay_pause(PG_FUNCTION_ARGS) +pg_wal_replay_pause(PG_FUNCTION_ARGS) { if (!RecoveryInProgress()) ereport(ERROR, @@ -554,13 +554,13 @@ pg_xlog_replay_pause(PG_FUNCTION_ARGS) } /* - * pg_xlog_replay_resume - resume recovery now + * pg_wal_replay_resume - resume recovery now * * Permission checking for this function is managed through the normal * GRANT system. */ Datum -pg_xlog_replay_resume(PG_FUNCTION_ARGS) +pg_wal_replay_resume(PG_FUNCTION_ARGS) { if (!RecoveryInProgress()) ereport(ERROR, @@ -574,10 +574,10 @@ pg_xlog_replay_resume(PG_FUNCTION_ARGS) } /* - * pg_is_xlog_replay_paused + * pg_is_recovery_paused */ Datum -pg_is_xlog_replay_paused(PG_FUNCTION_ARGS) +pg_is_recovery_paused(PG_FUNCTION_ARGS) { if (!RecoveryInProgress()) ereport(ERROR, @@ -619,7 +619,7 @@ pg_is_in_recovery(PG_FUNCTION_ARGS) * Compute the difference in bytes between two WAL locations. */ Datum -pg_xlog_location_diff(PG_FUNCTION_ARGS) +pg_wal_location_diff(PG_FUNCTION_ARGS) { Datum result; diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql index 31aade102b..93c9d13950 100644 --- a/src/backend/catalog/system_views.sql +++ b/src/backend/catalog/system_views.sql @@ -1050,8 +1050,11 @@ REVOKE EXECUTE ON FUNCTION pg_start_backup(text, boolean, boolean) FROM public; REVOKE EXECUTE ON FUNCTION pg_stop_backup() FROM public; REVOKE EXECUTE ON FUNCTION pg_stop_backup(boolean) FROM public; REVOKE EXECUTE ON FUNCTION pg_create_restore_point(text) FROM public; +REVOKE EXECUTE ON FUNCTION pg_switch_wal() FROM public; REVOKE EXECUTE ON FUNCTION pg_switch_xlog() FROM public; +REVOKE EXECUTE ON FUNCTION pg_wal_replay_pause() FROM public; REVOKE EXECUTE ON FUNCTION pg_xlog_replay_pause() FROM public; +REVOKE EXECUTE ON FUNCTION pg_wal_replay_resume() FROM public; REVOKE EXECUTE ON FUNCTION pg_xlog_replay_resume() FROM public; REVOKE EXECUTE ON FUNCTION pg_rotate_logfile() FROM public; REVOKE EXECUTE ON FUNCTION pg_reload_conf() FROM public; diff --git a/src/backend/po/de.po b/src/backend/po/de.po index 9ac21992a9..494d4a33f4 100644 --- a/src/backend/po/de.po +++ b/src/backend/po/de.po @@ -2052,8 +2052,8 @@ msgstr "Wiederherstellung wurde pausiert" #: access/transam/xlog.c:5643 #, c-format -msgid "Execute pg_xlog_replay_resume() to continue." -msgstr "Führen Sie pg_xlog_replay_resume() aus um fortzusetzen." +msgid "Execute pg_wal_replay_resume() to continue." +msgstr "Führen Sie pg_wal_replay_resume() aus um fortzusetzen." #: access/transam/xlog.c:5850 #, c-format @@ -2789,13 +2789,13 @@ msgstr "Wert zu lang für Restore-Punkt (maximal %d Zeichen)" #: access/transam/xlogfuncs.c:472 #, c-format -msgid "pg_xlogfile_name_offset() cannot be executed during recovery." -msgstr "pg_xlogfile_name_offset() kann nicht während der Wiederherstellung ausgeführt werden." +msgid "pg_wal_file_name_offset() cannot be executed during recovery." +msgstr "pg_wal_file_name_offset() kann nicht während der Wiederherstellung ausgeführt werden." #: access/transam/xlogfuncs.c:528 #, c-format -msgid "pg_xlogfile_name() cannot be executed during recovery." -msgstr "pg_xlogfile_name() kann nicht während der Wiederherstellung ausgeführt werden." +msgid "pg_wal_file_name() cannot be executed during recovery." +msgstr "pg_wal_file_name() kann nicht während der Wiederherstellung ausgeführt werden." #: access/transam/xlogfuncs.c:548 access/transam/xlogfuncs.c:568 #: access/transam/xlogfuncs.c:585 diff --git a/src/backend/po/es.po b/src/backend/po/es.po index 955531c295..6948c06fc4 100644 --- a/src/backend/po/es.po +++ b/src/backend/po/es.po @@ -2120,8 +2120,8 @@ msgstr "la recuperación está en pausa" #: access/transam/xlog.c:5645 #, c-format -msgid "Execute pg_xlog_replay_resume() to continue." -msgstr "Ejecute pg_xlog_replay_resume() para continuar." +msgid "Execute pg_wal_replay_resume() to continue." +msgstr "Ejecute pg_wal_replay_resume() para continuar." #: access/transam/xlog.c:5852 #, c-format @@ -2873,13 +2873,13 @@ msgstr "el valor es demasiado largo para un punto de recuperación (máximo %d c #: access/transam/xlogfuncs.c:473 #, c-format -msgid "pg_xlogfile_name_offset() cannot be executed during recovery." -msgstr "pg_xlogfile_name_offset() no puede ejecutarse durante la recuperación." +msgid "pg_wal_file_name_offset() cannot be executed during recovery." +msgstr "pg_wal_file_name_offset() no puede ejecutarse durante la recuperación." #: access/transam/xlogfuncs.c:529 #, c-format -msgid "pg_xlogfile_name() cannot be executed during recovery." -msgstr "pg_xlogfile_name() no puede ejecutarse durante la recuperación." +msgid "pg_wal_file_name() cannot be executed during recovery." +msgstr "pg_wal_file_name() no puede ejecutarse durante la recuperación." #: access/transam/xlogfuncs.c:549 access/transam/xlogfuncs.c:569 #: access/transam/xlogfuncs.c:586 diff --git a/src/backend/po/fr.po b/src/backend/po/fr.po index af5ee56238..3a59504cac 100644 --- a/src/backend/po/fr.po +++ b/src/backend/po/fr.po @@ -2039,8 +2039,8 @@ msgstr "restauration en pause" #: access/transam/xlog.c:5645 #, c-format -msgid "Execute pg_xlog_replay_resume() to continue." -msgstr "Exécuter pg_xlog_replay_resume() pour continuer." +msgid "Execute pg_wal_replay_resume() to continue." +msgstr "Exécuter pg_wal_replay_resume() pour continuer." #: access/transam/xlog.c:5852 #, c-format @@ -2803,13 +2803,13 @@ msgstr "valeur trop longue pour le point de restauration (%d caract #: access/transam/xlogfuncs.c:473 #, c-format -msgid "pg_xlogfile_name_offset() cannot be executed during recovery." -msgstr "pg_xlogfile_name_offset() ne peut pas être exécuté lors de la restauration." +msgid "pg_wal_file_name_offset() cannot be executed during recovery." +msgstr "pg_wal_file_name_offset() ne peut pas être exécuté lors de la restauration." #: access/transam/xlogfuncs.c:529 #, c-format -msgid "pg_xlogfile_name() cannot be executed during recovery." -msgstr "pg_xlogfile_name() ne peut pas être exécuté lors de la restauration." +msgid "pg_wal_file_name() cannot be executed during recovery." +msgstr "pg_wal_file_name() ne peut pas être exécuté lors de la restauration." #: access/transam/xlogfuncs.c:549 access/transam/xlogfuncs.c:569 access/transam/xlogfuncs.c:586 #, c-format diff --git a/src/backend/po/id.po b/src/backend/po/id.po index d5d484132b..4e01aa989f 100644 --- a/src/backend/po/id.po +++ b/src/backend/po/id.po @@ -1259,8 +1259,8 @@ msgstr "pemulihan berhenti" #: access/transam/xlog.c:4669 #, c-format -msgid "Execute pg_xlog_replay_resume() to continue." -msgstr "Menjalankan pg_xlog_replay_resume() untuk melanjutan." +msgid "Execute pg_wal_replay_resume() to continue." +msgstr "Menjalankan pg_wal_replay_resume() untuk melanjutan." #: access/transam/xlog.c:4799 #, c-format @@ -1911,8 +1911,8 @@ msgstr "nilai terlalu panjang untuk titik pemgembalian point (maksimal %d karakt #: access/transam/xlogfuncs.c:300 #, c-format -msgid "pg_xlogfile_name_offset() cannot be executed during recovery." -msgstr "pg_xlogfile_name_offset() tidak dapat dijalankan selama proses pemulihan." +msgid "pg_wal_file_name_offset() cannot be executed during recovery." +msgstr "pg_wal_file_name_offset() tidak dapat dijalankan selama proses pemulihan." #: access/transam/xlogfuncs.c:312 access/transam/xlogfuncs.c:383 access/transam/xlogfuncs.c:540 access/transam/xlogfuncs.c:546 #, c-format @@ -1921,8 +1921,8 @@ msgstr "tidak dapat menguraikan file log transaksi « %s »" #: access/transam/xlogfuncs.c:374 #, c-format -msgid "pg_xlogfile_name() cannot be executed during recovery." -msgstr "pg_xlogfile_name() tidak dapat menjalankan selama proses pemulihan." +msgid "pg_wal_file_name() cannot be executed during recovery." +msgstr "pg_wal_file_name() tidak dapat menjalankan selama proses pemulihan." #: access/transam/xlogfuncs.c:402 access/transam/xlogfuncs.c:424 access/transam/xlogfuncs.c:446 #, c-format diff --git a/src/backend/po/it.po b/src/backend/po/it.po index 393ed954ae..39a8cab4b2 100644 --- a/src/backend/po/it.po +++ b/src/backend/po/it.po @@ -2069,8 +2069,8 @@ msgstr "ripristino in pausa" #: access/transam/xlog.c:5645 #, c-format -msgid "Execute pg_xlog_replay_resume() to continue." -msgstr "Esegui pg_xlog_replay_resume() per continuare." +msgid "Execute pg_wal_replay_resume() to continue." +msgstr "Esegui pg_wal_replay_resume() per continuare." #: access/transam/xlog.c:5852 #, c-format @@ -2812,13 +2812,13 @@ msgstr "il valore è troppo lungo per un punto di ripristino (massimo %d caratte #: access/transam/xlogfuncs.c:473 #, c-format -msgid "pg_xlogfile_name_offset() cannot be executed during recovery." -msgstr "pg_xlogfile_name_offset() non può essere eseguito durante il recupero." +msgid "pg_wal_file_name_offset() cannot be executed during recovery." +msgstr "pg_wal_file_name_offset() non può essere eseguito durante il recupero." #: access/transam/xlogfuncs.c:529 #, c-format -msgid "pg_xlogfile_name() cannot be executed during recovery." -msgstr "pg_xlogfile_name() non può essere eseguito durante il recupero." +msgid "pg_wal_file_name() cannot be executed during recovery." +msgstr "pg_wal_file_name() non può essere eseguito durante il recupero." #: access/transam/xlogfuncs.c:549 access/transam/xlogfuncs.c:569 #: access/transam/xlogfuncs.c:586 diff --git a/src/backend/po/ja.po b/src/backend/po/ja.po index 2fa5d48a82..f42b889656 100644 --- a/src/backend/po/ja.po +++ b/src/backend/po/ja.po @@ -1347,8 +1347,8 @@ msgstr "ãªã«ããªã¯ãã§ã«åæ¢ããã¦ãã¾ã" #: access/transam/xlog.c:5804 #, c-format -msgid "Execute pg_xlog_replay_resume() to continue." -msgstr "pg_xlog_replay_resume() ãåããã¦å¦çãç¶ç¶ãã¦ãã ãã" +msgid "Execute pg_wal_replay_resume() to continue." +msgstr "pg_wal_replay_resume() ãåããã¦å¦çãç¶ç¶ãã¦ãã ãã" #: access/transam/xlog.c:5934 #, c-format @@ -2042,8 +2042,8 @@ msgstr "ãªã¹ãã¢ãã¤ã³ãã¨ãã¦ã¯å¤ãé·ããã¾ãï¼æ大 %d #: access/transam/xlogfuncs.c:290 #, c-format -msgid "pg_xlogfile_name_offset() cannot be executed during recovery." -msgstr "ãªã«ããªä¸ã¯ pg_xlogfile_name_offset() ãå®è¡ã§ãã¾ãã" +msgid "pg_wal_file_name_offset() cannot be executed during recovery." +msgstr "ãªã«ããªä¸ã¯ pg_wal_file_name_offset() ãå®è¡ã§ãã¾ãã" #: access/transam/xlogfuncs.c:302 access/transam/xlogfuncs.c:373 #: access/transam/xlogfuncs.c:530 access/transam/xlogfuncs.c:536 @@ -2053,8 +2053,8 @@ msgstr "ãã©ã³ã¶ã¯ã·ã§ã³ãã°ä½ç½®\"%s\"ã解æã§ãã¾ããã§ã #: access/transam/xlogfuncs.c:364 #, c-format -msgid "pg_xlogfile_name() cannot be executed during recovery." -msgstr "ãªã«ããªä¸ã¯ pg_xlogfile_name() ãå®è¡ã§ãã¾ãã" +msgid "pg_wal_file_name() cannot be executed during recovery." +msgstr "ãªã«ããªä¸ã¯ pg_wal_file_name() ãå®è¡ã§ãã¾ãã" #: access/transam/xlogfuncs.c:392 access/transam/xlogfuncs.c:414 #: access/transam/xlogfuncs.c:436 diff --git a/src/backend/po/pl.po b/src/backend/po/pl.po index 677badf5be..7c50e80229 100644 --- a/src/backend/po/pl.po +++ b/src/backend/po/pl.po @@ -2081,8 +2081,8 @@ msgstr "odzyskiwanie zostaÅo wstrzymane" #: access/transam/xlog.c:5645 #, c-format -msgid "Execute pg_xlog_replay_resume() to continue." -msgstr "Wykonaj pg_xlog_replay_resume() by kontynuowaÄ." +msgid "Execute pg_wal_replay_resume() to continue." +msgstr "Wykonaj pg_wal_replay_resume() by kontynuowaÄ." #: access/transam/xlog.c:5852 #, c-format @@ -2834,13 +2834,13 @@ msgstr "wartoÅÄ zbyt dÅuga punktu przywrócenia (maksimum %d znaków)" #: access/transam/xlogfuncs.c:472 #, c-format -msgid "pg_xlogfile_name_offset() cannot be executed during recovery." -msgstr "pg_xlogfile_name_offset() nie może byÄ uruchomiony podczas trwania odzyskiwania." +msgid "pg_wal_file_name_offset() cannot be executed during recovery." +msgstr "pg_wal_file_name_offset() nie może byÄ uruchomiony podczas trwania odzyskiwania." #: access/transam/xlogfuncs.c:528 #, c-format -msgid "pg_xlogfile_name() cannot be executed during recovery." -msgstr "pg_xlogfile_name() nie może byÄ uruchomiony podczas trwania." +msgid "pg_wal_file_name() cannot be executed during recovery." +msgstr "pg_wal_file_name() nie może byÄ uruchomiony podczas trwania." #: access/transam/xlogfuncs.c:548 access/transam/xlogfuncs.c:568 #: access/transam/xlogfuncs.c:585 diff --git a/src/backend/po/pt_BR.po b/src/backend/po/pt_BR.po index 37e4a28f07..438c4c2339 100644 --- a/src/backend/po/pt_BR.po +++ b/src/backend/po/pt_BR.po @@ -1480,8 +1480,8 @@ msgstr "recuperação está em pausa" #: access/transam/xlog.c:5699 #, c-format -msgid "Execute pg_xlog_replay_resume() to continue." -msgstr "Execute pg_xlog_replay_resume() para continuar." +msgid "Execute pg_wal_replay_resume() to continue." +msgstr "Execute pg_wal_replay_resume() para continuar." #: access/transam/xlog.c:5914 #, c-format @@ -2143,13 +2143,13 @@ msgstr "valor é muito longo para ponto de restauração (máximo de %d caracter #: access/transam/xlogfuncs.c:271 #, c-format -msgid "pg_xlogfile_name_offset() cannot be executed during recovery." -msgstr "pg_xlogfile_name_offset() não pode ser executado durante recuperação." +msgid "pg_wal_file_name_offset() cannot be executed during recovery." +msgstr "pg_wal_file_name_offset() não pode ser executado durante recuperação." #: access/transam/xlogfuncs.c:327 #, c-format -msgid "pg_xlogfile_name() cannot be executed during recovery." -msgstr "pg_xlogfile_name() não pode ser executado durante recuperação." +msgid "pg_wal_file_name() cannot be executed during recovery." +msgstr "pg_wal_file_name() não pode ser executado durante recuperação." #: access/transam/xlogfuncs.c:344 access/transam/xlogfuncs.c:366 #, c-format diff --git a/src/backend/po/ru.po b/src/backend/po/ru.po index 5bd8059a9d..f9d5a4731f 100644 --- a/src/backend/po/ru.po +++ b/src/backend/po/ru.po @@ -2401,8 +2401,8 @@ msgstr "воÑÑÑановление пÑиоÑÑановлено" #: access/transam/xlog.c:5645 #, c-format -msgid "Execute pg_xlog_replay_resume() to continue." -msgstr "ÐÑполниÑе pg_xlog_replay_resume() Ð´Ð»Ñ Ð¿ÑодолжениÑ." +msgid "Execute pg_wal_replay_resume() to continue." +msgstr "ÐÑполниÑе pg_wal_replay_resume() Ð´Ð»Ñ Ð¿ÑодолжениÑ." #: access/transam/xlog.c:5852 #, c-format @@ -3265,14 +3265,14 @@ msgstr "знаÑение Ð´Ð»Ñ ÑоÑки воÑÑÑÐ°Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ Ð¿Ñев #: access/transam/xlogfuncs.c:472 #, c-format -msgid "pg_xlogfile_name_offset() cannot be executed during recovery." +msgid "pg_wal_file_name_offset() cannot be executed during recovery." msgstr "" -"ФÑнкÑÐ¸Ñ pg_xlogfile_name_offset() нелÑÐ·Ñ Ð²ÑзÑваÑÑ Ð²Ð¾ вÑÐµÐ¼Ñ Ð²Ð¾ÑÑÑановлениÑ." +"ФÑнкÑÐ¸Ñ pg_wal_file_name_offset() нелÑÐ·Ñ Ð²ÑзÑваÑÑ Ð²Ð¾ вÑÐµÐ¼Ñ Ð²Ð¾ÑÑÑановлениÑ." #: access/transam/xlogfuncs.c:528 #, c-format -msgid "pg_xlogfile_name() cannot be executed during recovery." -msgstr "ФÑнкÑÐ¸Ñ pg_xlogfile_name() нелÑÐ·Ñ Ð²ÑзÑваÑÑ Ð² пÑоÑеÑÑе воÑÑÑановлениÑ." +msgid "pg_wal_file_name() cannot be executed during recovery." +msgstr "ФÑнкÑÐ¸Ñ pg_wal_file_name() нелÑÐ·Ñ Ð²ÑзÑваÑÑ Ð² пÑоÑеÑÑе воÑÑÑановлениÑ." #: access/transam/xlogfuncs.c:548 access/transam/xlogfuncs.c:568 #: access/transam/xlogfuncs.c:585 diff --git a/src/backend/po/zh_CN.po b/src/backend/po/zh_CN.po index 1e6934a7a5..7ac1690cb0 100644 --- a/src/backend/po/zh_CN.po +++ b/src/backend/po/zh_CN.po @@ -2229,8 +2229,8 @@ msgstr "æ¢å¤æä½å·²æå" #: access/transam/xlog.c:5645 #, c-format -msgid "Execute pg_xlog_replay_resume() to continue." -msgstr "æ§è¡ pg_xlog_replay_resume() 以继ç»." +msgid "Execute pg_wal_replay_resume() to continue." +msgstr "æ§è¡ pg_wal_replay_resume() 以继ç»." #: access/transam/xlog.c:5852 #, c-format @@ -3055,13 +3055,13 @@ msgstr "æ¢å¤ç¹å¼è¶ é¿(æ大%d个å符)" #: access/transam/xlogfuncs.c:473 #, c-format -msgid "pg_xlogfile_name_offset() cannot be executed during recovery." -msgstr "å¨æ¢å¤è¿ç¨ä¸ä¸è½æ§è¡pg_xlogfile_name_offset()" +msgid "pg_wal_file_name_offset() cannot be executed during recovery." +msgstr "å¨æ¢å¤è¿ç¨ä¸ä¸è½æ§è¡pg_wal_file_name_offset()" #: access/transam/xlogfuncs.c:529 #, c-format -msgid "pg_xlogfile_name() cannot be executed during recovery." -msgstr "å¨æ¢å¤è¿ç¨ä¸æ æ³æ§è¡pg_xlogfile_name() " +msgid "pg_wal_file_name() cannot be executed during recovery." +msgstr "å¨æ¢å¤è¿ç¨ä¸æ æ³æ§è¡pg_wal_file_name() " #: access/transam/xlogfuncs.c:549 access/transam/xlogfuncs.c:569 #: access/transam/xlogfuncs.c:586 diff --git a/src/bin/pg_rewind/RewindTest.pm b/src/bin/pg_rewind/RewindTest.pm index 1c482617ad..c67212ff7a 100644 --- a/src/bin/pg_rewind/RewindTest.pm +++ b/src/bin/pg_rewind/RewindTest.pm @@ -156,7 +156,7 @@ sub promote_standby # Wait for the standby to receive and write all WAL. my $wal_received_query = -"SELECT pg_current_xlog_location() = write_location FROM pg_stat_replication WHERE application_name = 'rewind_standby';"; +"SELECT pg_current_wal_location() = write_location FROM pg_stat_replication WHERE application_name = 'rewind_standby';"; $node_master->poll_query_until('postgres', $wal_received_query) or die "Timed out while waiting for standby to receive and write WAL"; diff --git a/src/bin/pg_rewind/libpq_fetch.c b/src/bin/pg_rewind/libpq_fetch.c index a903849ee4..d2374201c6 100644 --- a/src/bin/pg_rewind/libpq_fetch.c +++ b/src/bin/pg_rewind/libpq_fetch.c @@ -121,7 +121,7 @@ run_simple_query(const char *sql) } /* - * Calls pg_current_xlog_insert_location() function + * Calls pg_current_wal_insert_location() function */ XLogRecPtr libpqGetCurrentXlogInsertLocation(void) @@ -131,7 +131,7 @@ libpqGetCurrentXlogInsertLocation(void) uint32 lo; char *val; - val = run_simple_query("SELECT pg_current_xlog_insert_location()"); + val = run_simple_query("SELECT pg_current_wal_insert_location()"); if (sscanf(val, "%X/%X", &hi, &lo) != 2) pg_fatal("unrecognized result \"%s\" for current WAL insert location\n", val); diff --git a/src/include/access/xlog_fn.h b/src/include/access/xlog_fn.h index a013d047a2..a46b2f995c 100644 --- a/src/include/access/xlog_fn.h +++ b/src/include/access/xlog_fn.h @@ -16,21 +16,21 @@ extern Datum pg_start_backup(PG_FUNCTION_ARGS); extern Datum pg_stop_backup(PG_FUNCTION_ARGS); extern Datum pg_stop_backup_v2(PG_FUNCTION_ARGS); -extern Datum pg_switch_xlog(PG_FUNCTION_ARGS); +extern Datum pg_switch_wal(PG_FUNCTION_ARGS); extern Datum pg_create_restore_point(PG_FUNCTION_ARGS); -extern Datum pg_current_xlog_location(PG_FUNCTION_ARGS); -extern Datum pg_current_xlog_insert_location(PG_FUNCTION_ARGS); -extern Datum pg_current_xlog_flush_location(PG_FUNCTION_ARGS); -extern Datum pg_last_xlog_receive_location(PG_FUNCTION_ARGS); -extern Datum pg_last_xlog_replay_location(PG_FUNCTION_ARGS); +extern Datum pg_current_wal_location(PG_FUNCTION_ARGS); +extern Datum pg_current_wal_insert_location(PG_FUNCTION_ARGS); +extern Datum pg_current_wal_flush_location(PG_FUNCTION_ARGS); +extern Datum pg_last_wal_receive_location(PG_FUNCTION_ARGS); +extern Datum pg_last_wal_replay_location(PG_FUNCTION_ARGS); extern Datum pg_last_xact_replay_timestamp(PG_FUNCTION_ARGS); -extern Datum pg_xlogfile_name_offset(PG_FUNCTION_ARGS); -extern Datum pg_xlogfile_name(PG_FUNCTION_ARGS); +extern Datum pg_wal_file_name_offset(PG_FUNCTION_ARGS); +extern Datum pg_wal_file_name(PG_FUNCTION_ARGS); extern Datum pg_is_in_recovery(PG_FUNCTION_ARGS); -extern Datum pg_xlog_replay_pause(PG_FUNCTION_ARGS); -extern Datum pg_xlog_replay_resume(PG_FUNCTION_ARGS); -extern Datum pg_is_xlog_replay_paused(PG_FUNCTION_ARGS); -extern Datum pg_xlog_location_diff(PG_FUNCTION_ARGS); +extern Datum pg_wal_replay_pause(PG_FUNCTION_ARGS); +extern Datum pg_wal_replay_resume(PG_FUNCTION_ARGS); +extern Datum pg_is_recovery_paused(PG_FUNCTION_ARGS); +extern Datum pg_wal_location_diff(PG_FUNCTION_ARGS); extern Datum pg_is_in_backup(PG_FUNCTION_ARGS); extern Datum pg_backup_start_time(PG_FUNCTION_ARGS); diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index 37e022dc0d..17471b4199 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -3141,23 +3141,37 @@ DATA(insert OID = 3813 ( pg_is_in_backup PGNSP PGUID 12 1 0 0 0 f f f f t f v s DESCR("true if server is in online backup"); DATA(insert OID = 3814 ( pg_backup_start_time PGNSP PGUID 12 1 0 0 0 f f f f t f s s 0 0 1184 "" _null_ _null_ _null_ _null_ _null_ pg_backup_start_time _null_ _null_ _null_ )); DESCR("start time of an online backup"); -DATA(insert OID = 2848 ( pg_switch_xlog PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_switch_xlog _null_ _null_ _null_ )); -DESCR("switch to new xlog file"); +DATA(insert OID = 3449 ( pg_switch_wal PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_switch_wal _null_ _null_ _null_ )); +DESCR("switch to new WAL file"); +DATA(insert OID = 2848 ( pg_switch_xlog PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_switch_wal _null_ _null_ _null_ )); +DESCR("historical alias for pg_switch_wal"); DATA(insert OID = 3098 ( pg_create_restore_point PGNSP PGUID 12 1 0 0 0 f f f f t f v s 1 0 3220 "25" _null_ _null_ _null_ _null_ _null_ pg_create_restore_point _null_ _null_ _null_ )); DESCR("create a named restore point"); -DATA(insert OID = 2849 ( pg_current_xlog_location PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_current_xlog_location _null_ _null_ _null_ )); -DESCR("current xlog write location"); -DATA(insert OID = 2852 ( pg_current_xlog_insert_location PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_current_xlog_insert_location _null_ _null_ _null_ )); -DESCR("current xlog insert location"); -DATA(insert OID = 3330 ( pg_current_xlog_flush_location PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_current_xlog_flush_location _null_ _null_ _null_ )); -DESCR("current xlog flush location"); -DATA(insert OID = 2850 ( pg_xlogfile_name_offset PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 2249 "3220" "{3220,25,23}" "{i,o,o}" "{wal_location,file_name,file_offset}" _null_ _null_ pg_xlogfile_name_offset _null_ _null_ _null_ )); -DESCR("xlog filename and byte offset, given an xlog location"); -DATA(insert OID = 2851 ( pg_xlogfile_name PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 25 "3220" _null_ _null_ _null_ _null_ _null_ pg_xlogfile_name _null_ _null_ _null_ )); -DESCR("xlog filename, given an xlog location"); - -DATA(insert OID = 3165 ( pg_xlog_location_diff PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 1700 "3220 3220" _null_ _null_ _null_ _null_ _null_ pg_xlog_location_diff _null_ _null_ _null_ )); -DESCR("difference in bytes, given two xlog locations"); +DATA(insert OID = 3800 ( pg_current_wal_location PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_current_wal_location _null_ _null_ _null_ )); +DESCR("current WAL write location"); +DATA(insert OID = 2849 ( pg_current_xlog_location PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_current_wal_location _null_ _null_ _null_ )); +DESCR("historical alias for pg_current_xlog_location"); +DATA(insert OID = 3801 ( pg_current_wal_insert_location PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_current_wal_insert_location _null_ _null_ _null_ )); +DESCR("current WAL insert location"); +DATA(insert OID = 2852 ( pg_current_xlog_insert_location PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_current_wal_insert_location _null_ _null_ _null_ )); +DESCR("historical alias for pg_current_wal_insert_location"); +DATA(insert OID = 6015 ( pg_current_wal_flush_location PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_current_wal_flush_location _null_ _null_ _null_ )); +DESCR("current WAL flush location"); +DATA(insert OID = 3330 ( pg_current_xlog_flush_location PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_current_wal_flush_location _null_ _null_ _null_ )); +DESCR("historical alias for pg_current_wal_flush_location"); +DATA(insert OID = 3452 ( pg_wal_file_name_offset PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 2249 "3220" "{3220,25,23}" "{i,o,o}" "{wal_location,file_name,file_offset}" _null_ _null_ pg_wal_file_name_offset _null_ _null_ _null_ )); +DESCR("WAL filename and byte offset, given an WAL location"); +DATA(insert OID = 2850 ( pg_xlogfile_name_offset PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 2249 "3220" "{3220,25,23}" "{i,o,o}" "{wal_location,file_name,file_offset}" _null_ _null_ pg_wal_file_name_offset _null_ _null_ _null_ )); +DESCR("historical alias for pg_wal_file_name_offset"); +DATA(insert OID = 3453 ( pg_wal_file_name PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 25 "3220" _null_ _null_ _null_ _null_ _null_ pg_wal_file_name _null_ _null_ _null_ )); +DESCR("WAL filename, given a WAL location"); +DATA(insert OID = 2851 ( pg_xlogfile_name PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 25 "3220" _null_ _null_ _null_ _null_ _null_ pg_wal_file_name _null_ _null_ _null_ )); +DESCR("historical alias for pg_wal_file_name"); + +DATA(insert OID = 3445 ( pg_wal_location_diff PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 1700 "3220 3220" _null_ _null_ _null_ _null_ _null_ pg_wal_location_diff _null_ _null_ _null_ )); +DESCR("difference in bytes, given two WAL locations"); +DATA(insert OID = 3165 ( pg_xlog_location_diff PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 1700 "3220 3220" _null_ _null_ _null_ _null_ _null_ pg_wal_location_diff _null_ _null_ _null_ )); +DESCR("historical alias for pg_wal_location_diff"); DATA(insert OID = 3809 ( pg_export_snapshot PGNSP PGUID 12 1 0 0 0 f f f f t f v u 0 0 25 "" _null_ _null_ _null_ _null_ _null_ pg_export_snapshot _null_ _null_ _null_ )); DESCR("export a snapshot"); @@ -3165,19 +3179,29 @@ DESCR("export a snapshot"); DATA(insert OID = 3810 ( pg_is_in_recovery PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 16 "" _null_ _null_ _null_ _null_ _null_ pg_is_in_recovery _null_ _null_ _null_ )); DESCR("true if server is in recovery"); -DATA(insert OID = 3820 ( pg_last_xlog_receive_location PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_last_xlog_receive_location _null_ _null_ _null_ )); -DESCR("current xlog flush location"); -DATA(insert OID = 3821 ( pg_last_xlog_replay_location PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_last_xlog_replay_location _null_ _null_ _null_ )); -DESCR("last xlog replay location"); +DATA(insert OID = 3446 ( pg_last_wal_receive_location PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_last_wal_receive_location _null_ _null_ _null_ )); +DESCR("current wal flush location"); +DATA(insert OID = 3820 ( pg_last_xlog_receive_location PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_last_wal_receive_location _null_ _null_ _null_ )); +DESCR("historical alias for pg_last_wal_receive_location"); +DATA(insert OID = 3447 ( pg_last_wal_replay_location PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_last_wal_replay_location _null_ _null_ _null_ )); +DESCR("last wal replay location"); +DATA(insert OID = 3821 ( pg_last_xlog_replay_location PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_last_wal_replay_location _null_ _null_ _null_ )); +DESCR("historical alias for pg_last_wal_replay_location"); DATA(insert OID = 3830 ( pg_last_xact_replay_timestamp PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 1184 "" _null_ _null_ _null_ _null_ _null_ pg_last_xact_replay_timestamp _null_ _null_ _null_ )); DESCR("timestamp of last replay xact"); -DATA(insert OID = 3071 ( pg_xlog_replay_pause PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 2278 "" _null_ _null_ _null_ _null_ _null_ pg_xlog_replay_pause _null_ _null_ _null_ )); -DESCR("pause xlog replay"); -DATA(insert OID = 3072 ( pg_xlog_replay_resume PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 2278 "" _null_ _null_ _null_ _null_ _null_ pg_xlog_replay_resume _null_ _null_ _null_ )); -DESCR("resume xlog replay, if it was paused"); -DATA(insert OID = 3073 ( pg_is_xlog_replay_paused PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 16 "" _null_ _null_ _null_ _null_ _null_ pg_is_xlog_replay_paused _null_ _null_ _null_ )); -DESCR("true if xlog replay is paused"); +DATA(insert OID = 3450 ( pg_wal_replay_pause PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 2278 "" _null_ _null_ _null_ _null_ _null_ pg_wal_replay_pause _null_ _null_ _null_ )); +DESCR("pause WAL replay"); +DATA(insert OID = 3071 ( pg_xlog_replay_pause PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 2278 "" _null_ _null_ _null_ _null_ _null_ pg_wal_replay_pause _null_ _null_ _null_ )); +DESCR("historical alias for pg_wal_replay_pause"); +DATA(insert OID = 3451 ( pg_wal_replay_resume PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 2278 "" _null_ _null_ _null_ _null_ _null_ pg_wal_replay_resume _null_ _null_ _null_ )); +DESCR("resume WAL replay, if it was paused"); +DATA(insert OID = 3072 ( pg_xlog_replay_resume PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 2278 "" _null_ _null_ _null_ _null_ _null_ pg_wal_replay_resume _null_ _null_ _null_ )); +DESCR("historical alias for pg_wal_replay_resume"); +DATA(insert OID = 3448 ( pg_is_recovery_paused PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 16 "" _null_ _null_ _null_ _null_ _null_ pg_is_recovery_paused _null_ _null_ _null_ )); +DESCR("true if WAL replay for recovery is paused"); +DATA(insert OID = 3073 ( pg_is_xlog_replay_paused PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 16 "" _null_ _null_ _null_ _null_ _null_ pg_is_recovery_paused _null_ _null_ _null_ )); +DESCR("historical alias for pg_is_recovery_paused"); DATA(insert OID = 2621 ( pg_reload_conf PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 16 "" _null_ _null_ _null_ _null_ _null_ pg_reload_conf _null_ _null_ _null_ )); DESCR("reload configuration files"); diff --git a/src/test/modules/commit_ts/t/002_standby.pl b/src/test/modules/commit_ts/t/002_standby.pl index 4dbde2978e..3d43b3577c 100644 --- a/src/test/modules/commit_ts/t/002_standby.pl +++ b/src/test/modules/commit_ts/t/002_standby.pl @@ -32,9 +32,9 @@ my $master_ts = $master->safe_psql('postgres', qq{SELECT ts.* FROM pg_class, pg_xact_commit_timestamp(xmin) AS ts WHERE relname = 't10'} ); my $master_lsn = - $master->safe_psql('postgres', 'select pg_current_xlog_location()'); + $master->safe_psql('postgres', 'select pg_current_wal_location()'); $standby->poll_query_until('postgres', - qq{SELECT '$master_lsn'::pg_lsn <= pg_last_xlog_replay_location()}) + qq{SELECT '$master_lsn'::pg_lsn <= pg_last_wal_replay_location()}) or die "slave never caught up"; my $standby_ts = $standby->safe_psql('postgres', @@ -46,9 +46,9 @@ $master->append_conf('postgresql.conf', 'track_commit_timestamp = off'); $master->restart; $master->safe_psql('postgres', 'checkpoint'); $master_lsn = - $master->safe_psql('postgres', 'select pg_current_xlog_location()'); + $master->safe_psql('postgres', 'select pg_current_wal_location()'); $standby->poll_query_until('postgres', - qq{SELECT '$master_lsn'::pg_lsn <= pg_last_xlog_replay_location()}) + qq{SELECT '$master_lsn'::pg_lsn <= pg_last_wal_replay_location()}) or die "slave never caught up"; $standby->safe_psql('postgres', 'checkpoint'); diff --git a/src/test/modules/commit_ts/t/003_standby_2.pl b/src/test/modules/commit_ts/t/003_standby_2.pl index d37ff182c4..8d4e438989 100644 --- a/src/test/modules/commit_ts/t/003_standby_2.pl +++ b/src/test/modules/commit_ts/t/003_standby_2.pl @@ -31,9 +31,9 @@ $master->append_conf('postgresql.conf', 'track_commit_timestamp = off'); $master->restart; $master->safe_psql('postgres', 'checkpoint'); my $master_lsn = - $master->safe_psql('postgres', 'select pg_current_xlog_location()'); + $master->safe_psql('postgres', 'select pg_current_wal_location()'); $standby->poll_query_until('postgres', - qq{SELECT '$master_lsn'::pg_lsn <= pg_last_xlog_replay_location()}) + qq{SELECT '$master_lsn'::pg_lsn <= pg_last_wal_replay_location()}) or die "slave never caught up"; $standby->safe_psql('postgres', 'checkpoint'); diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm index 053c5ea787..d84b86105e 100644 --- a/src/test/perl/PostgresNode.pm +++ b/src/test/perl/PostgresNode.pm @@ -1343,11 +1343,11 @@ mode must be specified. sub lsn { my ($self, $mode) = @_; - my %modes = ('insert' => 'pg_current_xlog_insert_location()', - 'flush' => 'pg_current_xlog_flush_location()', - 'write' => 'pg_current_xlog_location()', - 'receive' => 'pg_last_xlog_receive_location()', - 'replay' => 'pg_last_xlog_replay_location()'); + my %modes = ('insert' => 'pg_current_wal_insert_location()', + 'flush' => 'pg_current_wal_flush_location()', + 'write' => 'pg_current_wal_location()', + 'receive' => 'pg_last_wal_receive_location()', + 'replay' => 'pg_last_wal_replay_location()'); $mode = '<undef>' if !defined($mode); die "unknown mode for 'lsn': '$mode', valid modes are " . join(', ', keys %modes) diff --git a/src/test/recovery/t/002_archiving.pl b/src/test/recovery/t/002_archiving.pl index fc2bf7ee1d..83b43bf84d 100644 --- a/src/test/recovery/t/002_archiving.pl +++ b/src/test/recovery/t/002_archiving.pl @@ -33,10 +33,10 @@ $node_standby->start; $node_master->safe_psql('postgres', "CREATE TABLE tab_int AS SELECT generate_series(1,1000) AS a"); my $current_lsn = - $node_master->safe_psql('postgres', "SELECT pg_current_xlog_location();"); + $node_master->safe_psql('postgres', "SELECT pg_current_wal_location();"); # Force archiving of WAL file to make it present on master -$node_master->safe_psql('postgres', "SELECT pg_switch_xlog()"); +$node_master->safe_psql('postgres', "SELECT pg_switch_wal()"); # Add some more content, it should not be present on standby $node_master->safe_psql('postgres', @@ -44,7 +44,7 @@ $node_master->safe_psql('postgres', # Wait until necessary replay has been done on standby my $caughtup_query = - "SELECT '$current_lsn'::pg_lsn <= pg_last_xlog_replay_location()"; + "SELECT '$current_lsn'::pg_lsn <= pg_last_wal_replay_location()"; $node_standby->poll_query_until('postgres', $caughtup_query) or die "Timed out while waiting for standby to catch up"; diff --git a/src/test/recovery/t/003_recovery_targets.pl b/src/test/recovery/t/003_recovery_targets.pl index a82545bf6f..b7b0caae68 100644 --- a/src/test/recovery/t/003_recovery_targets.pl +++ b/src/test/recovery/t/003_recovery_targets.pl @@ -32,7 +32,7 @@ sub test_recovery_standby # Wait until standby has replayed enough data my $caughtup_query = - "SELECT '$until_lsn'::pg_lsn <= pg_last_xlog_replay_location()"; + "SELECT '$until_lsn'::pg_lsn <= pg_last_wal_replay_location()"; $node_standby->poll_query_until('postgres', $caughtup_query) or die "Timed out while waiting for standby to catch up"; @@ -57,7 +57,7 @@ $node_master->start; $node_master->safe_psql('postgres', "CREATE TABLE tab_int AS SELECT generate_series(1,1000) AS a"); my $lsn1 = - $node_master->safe_psql('postgres', "SELECT pg_current_xlog_location();"); + $node_master->safe_psql('postgres', "SELECT pg_current_wal_location();"); # Take backup from which all operations will be run $node_master->backup('my_backup'); @@ -67,14 +67,14 @@ $node_master->backup('my_backup'); $node_master->safe_psql('postgres', "INSERT INTO tab_int VALUES (generate_series(1001,2000))"); my $ret = $node_master->safe_psql('postgres', - "SELECT pg_current_xlog_location(), txid_current();"); + "SELECT pg_current_wal_location(), txid_current();"); my ($lsn2, $recovery_txid) = split /\|/, $ret; # More data, with recovery target timestamp $node_master->safe_psql('postgres', "INSERT INTO tab_int VALUES (generate_series(2001,3000))"); $ret = $node_master->safe_psql('postgres', - "SELECT pg_current_xlog_location(), now();"); + "SELECT pg_current_wal_location(), now();"); my ($lsn3, $recovery_time) = split /\|/, $ret; # Even more data, this time with a recovery target name @@ -82,22 +82,22 @@ $node_master->safe_psql('postgres', "INSERT INTO tab_int VALUES (generate_series(3001,4000))"); my $recovery_name = "my_target"; my $lsn4 = - $node_master->safe_psql('postgres', "SELECT pg_current_xlog_location();"); + $node_master->safe_psql('postgres', "SELECT pg_current_wal_location();"); $node_master->safe_psql('postgres', "SELECT pg_create_restore_point('$recovery_name');"); # And now for a recovery target LSN $node_master->safe_psql('postgres', "INSERT INTO tab_int VALUES (generate_series(4001,5000))"); -my $recovery_lsn = $node_master->safe_psql('postgres', "SELECT pg_current_xlog_location()"); +my $recovery_lsn = $node_master->safe_psql('postgres', "SELECT pg_current_wal_location()"); my $lsn5 = - $node_master->safe_psql('postgres', "SELECT pg_current_xlog_location();"); + $node_master->safe_psql('postgres', "SELECT pg_current_wal_location();"); $node_master->safe_psql('postgres', "INSERT INTO tab_int VALUES (generate_series(5001,6000))"); # Force archiving of WAL file -$node_master->safe_psql('postgres', "SELECT pg_switch_xlog()"); +$node_master->safe_psql('postgres', "SELECT pg_switch_wal()"); # Test recovery targets my @recovery_params = ("recovery_target = 'immediate'"); diff --git a/src/test/recovery/t/005_replay_delay.pl b/src/test/recovery/t/005_replay_delay.pl index 640295bfa8..cd9e8f5c12 100644 --- a/src/test/recovery/t/005_replay_delay.pl +++ b/src/test/recovery/t/005_replay_delay.pl @@ -42,7 +42,7 @@ $node_master->safe_psql('postgres', # Now wait for replay to complete on standby. We're done waiting when the # slave has replayed up to the previously saved master LSN. my $until_lsn = - $node_master->safe_psql('postgres', "SELECT pg_current_xlog_location()"); + $node_master->safe_psql('postgres', "SELECT pg_current_wal_location()"); my $remaining = 90; while ($remaining-- > 0) @@ -50,7 +50,7 @@ while ($remaining-- > 0) # Done waiting? my $replay_status = $node_standby->safe_psql('postgres', - "SELECT (pg_last_xlog_replay_location() - '$until_lsn'::pg_lsn) >= 0" + "SELECT (pg_last_wal_replay_location() - '$until_lsn'::pg_lsn) >= 0" ); last if $replay_status eq 't'; diff --git a/src/test/recovery/t/008_fsm_truncation.pl b/src/test/recovery/t/008_fsm_truncation.pl index 9f6bdb0b64..4419fc258c 100644 --- a/src/test/recovery/t/008_fsm_truncation.pl +++ b/src/test/recovery/t/008_fsm_truncation.pl @@ -69,11 +69,11 @@ vacuum verbose testtab; $node_master->psql('postgres', 'checkpoint'); my $until_lsn = - $node_master->safe_psql('postgres', "SELECT pg_current_xlog_location();"); + $node_master->safe_psql('postgres', "SELECT pg_current_wal_location();"); # Wait long enough for standby to receive and apply all WAL my $caughtup_query = - "SELECT '$until_lsn'::pg_lsn <= pg_last_xlog_replay_location()"; + "SELECT '$until_lsn'::pg_lsn <= pg_last_wal_replay_location()"; $node_standby->poll_query_until('postgres', $caughtup_query) or die "Timed out while waiting for standby to catch up"; diff --git a/src/test/regress/expected/hs_standby_functions.out b/src/test/regress/expected/hs_standby_functions.out index 16d50a8285..e0af677ea1 100644 --- a/src/test/regress/expected/hs_standby_functions.out +++ b/src/test/regress/expected/hs_standby_functions.out @@ -15,7 +15,7 @@ select length(txid_current_snapshot()::text) >= 4; select pg_start_backup('should fail'); ERROR: recovery is in progress HINT: WAL control functions cannot be executed during recovery. -select pg_switch_xlog(); +select pg_switch_wal(); ERROR: recovery is in progress HINT: WAL control functions cannot be executed during recovery. select pg_stop_backup(); diff --git a/src/test/regress/sql/hs_primary_extremes.sql b/src/test/regress/sql/hs_primary_extremes.sql index 629efb4be5..2051e2e5cf 100644 --- a/src/test/regress/sql/hs_primary_extremes.sql +++ b/src/test/regress/sql/hs_primary_extremes.sql @@ -70,4 +70,4 @@ SELECT count(*) > 257 FROM pg_locks; COMMIT; SELECT hs_locks_drop(257); -SELECT pg_switch_xlog(); +SELECT pg_switch_wal(); diff --git a/src/test/regress/sql/hs_primary_setup.sql b/src/test/regress/sql/hs_primary_setup.sql index a00b367cbc..eeb4421307 100644 --- a/src/test/regress/sql/hs_primary_setup.sql +++ b/src/test/regress/sql/hs_primary_setup.sql @@ -22,4 +22,4 @@ insert into hs3 values (115); DROP sequence if exists hsseq; create sequence hsseq; -SELECT pg_switch_xlog(); +SELECT pg_switch_wal(); diff --git a/src/test/regress/sql/hs_standby_functions.sql b/src/test/regress/sql/hs_standby_functions.sql index 7577045f11..251bac0a43 100644 --- a/src/test/regress/sql/hs_standby_functions.sql +++ b/src/test/regress/sql/hs_standby_functions.sql @@ -10,7 +10,7 @@ select txid_current(); select length(txid_current_snapshot()::text) >= 4; select pg_start_backup('should fail'); -select pg_switch_xlog(); +select pg_switch_wal(); select pg_stop_backup(); -- should return no rows
smime.p7s
Description: S/MIME Cryptographic Signature