Hi,
On 2022-01-19 12:14:21 -0500, Tom Lane wrote:
> No, it was largely the same as what you have here, I think. I dug
> up my WIP patch and attach it below, just in case there's any ideas
> worth borrowing.
Heh, it does look quite similar.
> + "cp -a \"%s\" \"%s/data\" > \"%s/log/initdb.log\" 2>&1",
> + pg_proto_datadir,
> + temp_instance,
> + outputdir);
> + if (system(buf))
> + {
> + fprintf(stderr, _("\n%s: cp failed\nExamine %s/log/initdb.log for the reason.\nCommand was: %s\n"),
progname,outputdir, buf);
> + exit(2);
> + }
Both ours have this. Unfortunately on windows cp doesn't natively
exist. Although git does provide it. I tried a few things that appear to be
natively available (time is best of three executions):
gnu cp from git, cp -a tmp_install\initdb_template t\
670ms
xcopy.exe /E /Q tmp_install\initdb_template t\
638ms
robocopy /e /NFL /NDL tmp_install\initdb_template t\
575ms
So I guess we could use robocopy? That's shipped as part of windows starting in
windows 10... xcopy has been there for longer, so I might just default to that.
Greetings,
Andres Freund