diff options
author | Bruce Momjian <bruce@momjian.us> | 2003-05-04 04:42:52 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2003-05-04 04:42:52 +0000 |
commit | a59793f82c8bb7d9931dab8675d91e06c1a41f5a (patch) | |
tree | 95411f6bfecbe12082c1333573566083550a0ae1 /src/backend/commands/dbcommands.c | |
parent | 50ed78b805bf86c73206935ea8a8b2dce4f60698 (diff) | |
download | postgresql-a59793f82c8bb7d9931dab8675d91e06c1a41f5a.tar.gz postgresql-a59793f82c8bb7d9931dab8675d91e06c1a41f5a.zip |
Disable alternate locations on Win32 because it doesn't support symlinks.
Diffstat (limited to 'src/backend/commands/dbcommands.c')
-rw-r--r-- | src/backend/commands/dbcommands.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c index 3ef778c9648..6a680bc1a19 100644 --- a/src/backend/commands/dbcommands.c +++ b/src/backend/commands/dbcommands.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.112 2003/04/04 20:42:12 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.113 2003/05/04 04:42:52 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -174,6 +174,11 @@ createdb(const CreatedbStmt *stmt) /* don't call this in a transaction block */ PreventTransactionChain((void *) stmt, "CREATE DATABASE"); +#ifdef WIN32 + if (dbpath != NULL) /* platform has no symlinks */ + elog(ERROR, "CREATE DATABASE: may not use an alternate location on this platform"); +#endif + /* * Check for db name conflict. There is a race condition here, since * another backend could create the same DB name before we commit. @@ -296,7 +301,9 @@ createdb(const CreatedbStmt *stmt) /* Make the symlink, if needed */ if (alt_loc) { +#ifndef WIN32 /* already throws error on WIN32 above */ if (symlink(alt_loc, nominal_loc) != 0) +#endif elog(ERROR, "CREATE DATABASE: could not link '%s' to '%s': %m", nominal_loc, alt_loc); } |