Flexible options for BASE_BACKUP.
authorRobert Haas <rhaas@postgresql.org>
Tue, 5 Oct 2021 15:50:21 +0000 (11:50 -0400)
committerRobert Haas <rhaas@postgresql.org>
Tue, 5 Oct 2021 15:50:21 +0000 (11:50 -0400)
commit0ba281cb4bf9f5f65529dfa4c8282abb734dd454
treeaba158ac397631b53a39ef406927980cbc89f38b
parent68601985e699adeb267636fd19d3d6113554bd1f
Flexible options for BASE_BACKUP.

Previously, BASE_BACKUP used an entirely hard-coded syntax, but that's
hard to extend. Instead, adopt the same kind of syntax we've used for
SQL commands such as VACUUM, ANALYZE, COPY, and EXPLAIN, where it's
not necessary for all of the option names to be parser keywords.

In the new syntax, most of the options now take an optional Boolean
argument. To match our practice in other in places, the options which
the old syntax called NOWAIT and NOVERIFY_CHECKSUMS options are in the
new syntax called WAIT and VERIFY_CHECKUMS, and the default value is
false. In the new syntax, the FAST option has been replaced by a
CHECKSUM option whose value may be 'fast' or 'spread'.

This commit does not remove support for the old syntax. It just adds
the new one as an additional option, and makes pg_basebackup prefer
the new syntax when the server is new enough to support it.

Patch by me, reviewed and tested by Fabien Coelho, Sergei Kornilov,
Fujii Masao, and Tushar Ahuja.

Discussion: http://postgr.es/m/CA+TgmobAczXDRO_Gr2euo_TxgzaH1JxbNxvFx=HYvBinefNH8Q@mail.gmail.com
Discussion: http://postgr.es/m/CA+TgmoZGwR=ZVWFeecncubEyPdwghnvfkkdBe9BLccLSiqdf9Q@mail.gmail.com
doc/src/sgml/protocol.sgml
src/backend/replication/basebackup.c
src/backend/replication/repl_gram.y
src/bin/pg_basebackup/pg_basebackup.c
src/bin/pg_basebackup/streamutil.c
src/bin/pg_basebackup/streamutil.h