@@ -80,7 +80,6 @@ static void backup_files(void *arg);
8080static void do_backup_database (parray * backup_list );
8181
8282static void pg_start_backup (const char * label ,bool smooth ,pgBackup * backup );
83- static void pg_switch_wal (PGconn * conn );
8483static void pg_stop_backup (pgBackup * backup );
8584static int checkpoint_timeout (void );
8685
@@ -640,15 +639,6 @@ pg_start_backup(const char *label, bool smooth, pgBackup *backup)
640639
641640PQclear (res );
642641
643- /*
644- * Switch to a new WAL segment. It is necessary to get archived WAL
645- * segment, which includes start LSN of current backup.
646- *
647- * Do not switch for standby node and if backup is stream.
648- */
649- if (!stream_wal )
650- pg_switch_wal (conn );
651-
652642if (!stream_wal )
653643/*
654644 * Do not wait start_lsn for stream backup.
@@ -662,28 +652,6 @@ pg_start_backup(const char *label, bool smooth, pgBackup *backup)
662652wait_replica_wal_lsn (backup -> start_lsn , true);
663653}
664654
665- /*
666- * Switch to a new WAL segment. It should be called only for master.
667- */
668- static void
669- pg_switch_wal (PGconn * conn )
670- {
671- PGresult * res ;
672-
673- /* Remove annoying NOTICE messages generated by backend */
674- res = pgut_execute (conn ,"SET client_min_messages = warning;" ,0 ,NULL );
675- PQclear (res );
676-
677- if (server_version >=100000 )
678- res = pgut_execute (conn ,"SELECT * FROM pg_switch_wal()" ,0 ,
679- NULL );
680- else
681- res = pgut_execute (conn ,"SELECT * FROM pg_switch_xlog()" ,0 ,
682- NULL );
683-
684- PQclear (res );
685- }
686-
687655/*
688656 * Check if the instance supports ptrack
689657 * TODO Maybe we should rather check ptrack_version()?