1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Clean up CREATE DATABASE processing to make it more robust and get rid

of special case for Windows port.  Put a PG_TRY around most of createdb()
to ensure that we remove copied subdirectories on failure, even if the
failure happens while creating the pg_database row.  (I think this explains
Oliver Siegmar's recent report.)  Having done that, there's no need for
the fragile assumption that copydir() mustn't ereport(ERROR), so simplify
its API.  Eliminate the old code that used system("cp ...") to copy
subdirectories, in favor of using copydir() on all platforms.  This not
only should allow much better error reporting, but allows us to fsync
the created files before trusting that the copy has succeeded.
This commit is contained in:
Tom Lane
2005-08-02 19:02:32 +00:00
parent 0001e98d54
commit 558730ac6b
6 changed files with 283 additions and 287 deletions

8
configure vendored
View File

@ -14915,14 +14915,6 @@ fi
# Win32 support
if test "$PORTNAME" = "win32"; then
case $LIBOBJS in
"copydir.$ac_objext" | \
*" copydir.$ac_objext" | \
"copydir.$ac_objext "* | \
*" copydir.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS copydir.$ac_objext" ;;
esac
case $LIBOBJS in
"gettimeofday.$ac_objext" | \
*" gettimeofday.$ac_objext" | \