total size. If the estimation is disabled in
<application>pg_basebackup</application>
(i.e., <literal>--no-estimate-size</literal> option is specified),
- this is <literal>0</literal>.
+ this is <literal>NULL</literal>.
</entry>
</row>
<row>
amount of backup data that will be streamed, resulting in the
<literal>backup_total</literal> column in the
<structname>pg_stat_progress_basebackup</structname>
- to be <literal>0</literal>.
+ to be <literal>NULL</literal>.
</para>
<para>
Without this option, the backup will start by enumerating
WHEN 4 THEN 'waiting for wal archiving to finish'
WHEN 5 THEN 'transferring wal files'
END AS phase,
- S.param2 AS backup_total,
+ CASE S.param2 WHEN -1 THEN NULL ELSE S.param2 END AS backup_total,
S.param3 AS backup_streamed,
S.param4 AS tablespaces_total,
S.param5 AS tablespaces_streamed
/* Do not verify checksums. */
static bool noverify_checksums = false;
-/* Total amount of backup data that will be streamed */
+/*
+ * Total amount of backup data that will be streamed.
+ * -1 means that the size is not estimated.
+ */
static int64 backup_total = 0;
/* Amount of backup data already streamed */
backup_streamed = 0;
pgstat_progress_start_command(PROGRESS_COMMAND_BASEBACKUP, InvalidOid);
+ /*
+ * If the estimation of the total backup size is disabled, make the
+ * backup_total column in the view return NULL by setting the parameter to
+ * -1.
+ */
+ if (!opt->progress)
+ {
+ backup_total = -1;
+ pgstat_progress_update_param(PROGRESS_BASEBACKUP_BACKUP_TOTAL,
+ backup_total);
+ }
+
datadirpathlen = strlen(DataDir);
backup_started_in_recovery = RecoveryInProgress();
* will always be wrong if WAL is included), but that's better than having
* the done column be bigger than the total.
*/
- if (backup_total > 0 && backup_streamed > backup_total)
+ if (backup_total > -1 && backup_streamed > backup_total)
{
backup_total = backup_streamed;
val[nparam++] = backup_total;
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 202003191
+#define CATALOG_VERSION_NO 202003241
#endif
WHEN 5 THEN 'transferring wal files'::text
ELSE NULL::text
END AS phase,
- s.param2 AS backup_total,
+ CASE s.param2
+ WHEN '-1'::integer THEN NULL::bigint
+ ELSE s.param2
+ END AS backup_total,
s.param3 AS backup_streamed,
s.param4 AS tablespaces_total,
s.param5 AS tablespaces_streamed