OSDN Git Service

Clean up CREATE DATABASE processing to make it more robust and get rid
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 2 Aug 2005 19:02:32 +0000 (19:02 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 2 Aug 2005 19:02:32 +0000 (19:02 +0000)
commit558730ac6bbc668a75c7a7619beae5a1b34d965f
treed8928d1a5e9e5aefa53a6f96fd7d9237d40e872e
parent0001e98d54f3d81c2ff413e4aec4933bd1378963
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.
configure
configure.in
src/Makefile.global.in
src/backend/commands/dbcommands.c
src/include/port.h
src/port/copydir.c