Content-Length: 271102 | pFad | http://github.com/postgrespro/postgres/commit/ecbdc4c555f43b1ac284c734752b00c2ea6f277b

A8 Forbid invalid combination of options in pg_basebackup. · postgrespro/postgres@ecbdc4c · GitHub
Skip to content

Commit ecbdc4c

Browse files
committed
Forbid invalid combination of options in pg_basebackup.
Commit 56c7d8d allowed pg_basebackup to stream WAL in tar mode. But there is the restriction that WAL streaming in tar mode works only when the value - (dash) is not specified as output directory. This means that the combination of three options "-D -", "-F t" and "-X stream" is invalid. However, previously, even when those options were specified at the same time, pg_basebackup background process unexpectedly started streaming WAL. And then it exited with an error. This commit changes pg_basebackup so that it errors out on such invalid combination of options at the beginning. Reviewed by Magnus Hagander, and patch by me.
1 parent c080b22 commit ecbdc4c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/bin/pg_basebackup/pg_basebackup.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2268,6 +2268,16 @@ main(int argc, char **argv)
22682268
exit(1);
22692269
}
22702270

2271+
if (format == 't' && streamwal && strcmp(basedir, "-") == 0)
2272+
{
2273+
fprintf(stderr,
2274+
_("%s: cannot stream transaction logs in tar mode to stdout\n"),
2275+
progname);
2276+
fprintf(stderr, _("Try \"%s --help\" for more information.\n"),
2277+
progname);
2278+
exit(1);
2279+
}
2280+
22712281
if (replication_slot && !streamwal)
22722282
{
22732283
fprintf(stderr,

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/ecbdc4c555f43b1ac284c734752b00c2ea6f277b

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy