Index: configure =================================================================== RCS file: /cvsroot/pgsql-server/configure,v retrieving revision 1.259 diff -c -c -r1.259 configure *** configure 15 May 2003 16:35:23 -0000 1.259 --- configure 15 May 2003 17:53:31 -0000 *************** *** 11395,11402 **** esac # Win32 can't to rename or unlink on an open file ! case $host_os in win32*|mingw*) ! LIBOBJS="$LIBOBJS dirmod.$ac_objext" ;; esac if test "$with_readline" = yes; then --- 11395,11403 ---- esac # Win32 can't to rename or unlink on an open file ! case $host_os in mingw*) ! LIBOBJS="$LIBOBJS dirmod.$ac_objext" ! LIBOBJS="$LIBOBJS copydir.$ac_objext" ;; esac if test "$with_readline" = yes; then Index: configure.in =================================================================== RCS file: /cvsroot/pgsql-server/configure.in,v retrieving revision 1.250 diff -c -c -r1.250 configure.in *** configure.in 15 May 2003 16:35:27 -0000 1.250 --- configure.in 15 May 2003 17:53:32 -0000 *************** *** 863,870 **** esac # Win32 can't to rename or unlink on an open file ! case $host_os in win32*|mingw*) ! AC_LIBOBJ(dirmod) ;; esac if test "$with_readline" = yes; then --- 863,871 ---- esac # Win32 can't to rename or unlink on an open file ! case $host_os in mingw*) ! AC_LIBOBJ(dirmod) ! AC_LIBOBJ(copydir) ;; esac if test "$with_readline" = yes; then Index: src/backend/commands/dbcommands.c =================================================================== RCS file: /cvsroot/pgsql-server/src/backend/commands/dbcommands.c,v retrieving revision 1.114 diff -c -c -r1.114 dbcommands.c *** src/backend/commands/dbcommands.c 7 May 2003 03:47:08 -0000 1.114 --- src/backend/commands/dbcommands.c 15 May 2003 17:53:34 -0000 *************** *** 311,321 **** /* Copy the template database to the new location */ #ifndef WIN32 snprintf(buf, sizeof(buf), "cp -r '%s' '%s'", src_loc, target_dir); #else ! snprintf(buf, sizeof(buf), "xcopy /e /i /q '%s' '%s'", src_loc, target_dir); #endif - - if (system(buf) != 0) { if (remove_dbdirs(nominal_loc, alt_loc)) elog(ERROR, "CREATE DATABASE: could not initialize database directory"); --- 311,320 ---- /* Copy the template database to the new location */ #ifndef WIN32 snprintf(buf, sizeof(buf), "cp -r '%s' '%s'", src_loc, target_dir); + if (system(buf) != 0) #else ! if (copydir(src_loc, target_dir) != 0) #endif { if (remove_dbdirs(nominal_loc, alt_loc)) elog(ERROR, "CREATE DATABASE: could not initialize database directory");