Re: cross-platform pg_basebackup

2022-10-28 Thread Robert Haas
On Sun, Oct 23, 2022 at 10:44 PM Julien Rouhaud wrote: > On Fri, Oct 21, 2022 at 09:15:39AM -0400, Robert Haas wrote: > > Committed and back-patched to all supported branches. > > Is there any additional things to be taken care of or should > https://commitfest.postgresql.org/40/3954/ be closed?

Re: cross-platform pg_basebackup

2022-10-23 Thread Julien Rouhaud
Hi, On Fri, Oct 21, 2022 at 09:15:39AM -0400, Robert Haas wrote: > > Committed and back-patched to all supported branches. Is there any additional things to be taken care of or should https://commitfest.postgresql.org/40/3954/ be closed?

Re: cross-platform pg_basebackup

2022-10-21 Thread Robert Haas
On Fri, Oct 21, 2022 at 4:14 AM davinder singh wrote: > Hi, > Patch v2 looks good to me, I have tested it, and pg_basebackup works fine > across the platforms (Windows to Linux and Linux to Windows). > Syntax used for testing > $ pg_basebackup -h remote_server_ip -p 5432 -U user_name -D backup/da

Re: cross-platform pg_basebackup

2022-10-21 Thread davinder singh
Hi, Patch v2 looks good to me, I have tested it, and pg_basebackup works fine across the platforms (Windows to Linux and Linux to Windows). Syntax used for testing $ pg_basebackup -h remote_server_ip -p 5432 -U user_name -D backup/data -T olddir=newdir I have also tested with non-absolute paths, i

Re: cross-platform pg_basebackup

2022-10-20 Thread Andrew Dunstan
On 2022-10-20 Th 14:47, Robert Haas wrote: > On Thu, Oct 20, 2022 at 1:28 PM Tom Lane wrote: >> Robert Haas writes: >>> Cool. Here's a patch. >> LGTM, except I'd be inclined to ensure that all the macros >> are function-style, ie >> >> +#define IS_DIR_SEP(ch) IS_NONWINDOWS_DIR_SEP(ch) >> >> not

Re: cross-platform pg_basebackup

2022-10-20 Thread Robert Haas
On Thu, Oct 20, 2022 at 1:28 PM Tom Lane wrote: > Robert Haas writes: > > Cool. Here's a patch. > > LGTM, except I'd be inclined to ensure that all the macros > are function-style, ie > > +#define IS_DIR_SEP(ch) IS_NONWINDOWS_DIR_SEP(ch) > > not just > > +#define IS_DIR_SEP IS_NONWINDOWS_DIR_SEP

Re: cross-platform pg_basebackup

2022-10-20 Thread Tom Lane
Robert Haas writes: > Cool. Here's a patch. LGTM, except I'd be inclined to ensure that all the macros are function-style, ie +#define IS_DIR_SEP(ch) IS_NONWINDOWS_DIR_SEP(ch) not just +#define IS_DIR_SEP IS_NONWINDOWS_DIR_SEP I don't recall the exact rules, but I know that the second style c

Re: cross-platform pg_basebackup

2022-10-20 Thread Robert Haas
On Thu, Oct 20, 2022 at 12:17 PM Tom Lane wrote: > Robert Haas writes: > > However, I think we could relax the check a little bit, something > > along the lines of !is_nonwindows_absolute_path(cell->old_dir) && > > !is_windows_absolute_path(dir). We can't actually know whether the > > remote side

Re: cross-platform pg_basebackup

2022-10-20 Thread Tom Lane
Robert Haas writes: > However, I think we could relax the check a little bit, something > along the lines of !is_nonwindows_absolute_path(cell->old_dir) && > !is_windows_absolute_path(dir). We can't actually know whether the > remote side is Windows or non-Windows, but if the string we're given >

cross-platform pg_basebackup

2022-10-20 Thread Robert Haas
Suppose that, for some reason, you want to use pg_basebackup on a Linux machine to back up a database cluster on a Windows machine. Suppose further that you attempt to use the -T option. Then you might run afoul of this check: /* * This check isn't absolutely necessary. But all tablespac