*** a/doc/src/sgml/ref/pg_basebackup.sgml
--- b/doc/src/sgml/ref/pg_basebackup.sgml
***************
*** 206,215 **** PostgreSQL documentation
! Specifies the location for the transaction log directory.
xlogdir must be an absolute path.
The transaction log directory can only be specified when
! the backup is in plain mode.
--- 206,216 ----
! Specifies the location for the transaction log directory.
xlogdir must be an absolute path.
The transaction log directory can only be specified when
! the backup is in plain mode. It is better not to specify
! both data and transaction log directories are same.
*** a/src/bin/pg_basebackup/pg_basebackup.c
--- b/src/bin/pg_basebackup/pg_basebackup.c
***************
*** 1884,1889 **** main(int argc, char **argv)
--- 1884,1891 ----
if (strcmp(xlog_dir, "") != 0)
{
+ char *abs_basedir;
+
if (format != 'p')
{
fprintf(stderr,
***************
*** 1904,1909 **** main(int argc, char **argv)
--- 1906,1921 ----
progname);
exit(1);
}
+
+ abs_basedir = make_absolute_path_or_exit(progname, basedir);
+ if (strcmp(abs_basedir, xlog_dir) == 0)
+ {
+ fprintf(stderr, _("%s: Provided data and transaction log "
+ "directories are same\n"), progname);
+ exit(1);
+ }
+
+ pfree(abs_basedir);
}
#ifndef HAVE_LIBZ