diff --git a/doc/src/sgml/ref/pg_basebackup.sgml b/doc/src/sgml/ref/pg_basebackup.sgml index 7f1a608bd94c6..00236d2fb7276 100644 --- a/doc/src/sgml/ref/pg_basebackup.sgml +++ b/doc/src/sgml/ref/pg_basebackup.sgml @@ -361,7 +361,7 @@ PostgreSQL documentation - Sets checkpoint mode to fast or spread (default) (see ). + Sets checkpoint mode to fast (immediate) or spread (default) (see ). @@ -568,6 +568,14 @@ PostgreSQL documentation Notes + + At the beginning of the backup, a checkpoint needs to be written on the + server the backup is taken from. Especially if the option + --checkpoint=fast is not used, this can take some time + during which pg_basebackup will be appear + to be idle. + + The backup will include all files in the data directory and tablespaces, including the configuration files and any additional files placed in the diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c index ad0631f530769..2805da5fa7b41 100644 --- a/src/bin/pg_basebackup/pg_basebackup.c +++ b/src/bin/pg_basebackup/pg_basebackup.c @@ -1655,6 +1655,14 @@ BaseBackup(void) if (maxrate > 0) maxrate_clause = psprintf("MAX_RATE %u", maxrate); + if (verbose) + fprintf(stderr, + _("%s: initiating base backup, waiting for checkpoint to complete\n"), + progname); + + if (showprogress && !verbose) + fprintf(stderr, "waiting for checkpoint\r"); + basebkp = psprintf("BASE_BACKUP LABEL '%s' %s %s %s %s %s", escaped_label, @@ -1691,6 +1699,9 @@ BaseBackup(void) strlcpy(xlogstart, PQgetvalue(res, 0, 0), sizeof(xlogstart)); + if (verbose) + fprintf(stderr, _("%s: checkpoint completed\n"), progname); + /* * 9.3 and later sends the TLI of the starting point. With older servers, * assume it's the same as the latest timeline reported by