Skip to content

Commit a59793f

Browse files
committed
Disable alternate locations on Win32 because it doesn't support symlinks.
1 parent 50ed78b commit a59793f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/backend/commands/dbcommands.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.112 2003/04/04 20:42:12 momjian Exp $
12+
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.113 2003/05/04 04:42:52 momjian Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -174,6 +174,11 @@ createdb(const CreatedbStmt *stmt)
174174
/* don't call this in a transaction block */
175175
PreventTransactionChain((void *) stmt, "CREATE DATABASE");
176176

177+
#ifdef WIN32
178+
if (dbpath != NULL) /* platform has no symlinks */
179+
elog(ERROR, "CREATE DATABASE: may not use an alternate location on this platform");
180+
#endif
181+
177182
/*
178183
* Check for db name conflict. There is a race condition here, since
179184
* another backend could create the same DB name before we commit.
@@ -296,7 +301,9 @@ createdb(const CreatedbStmt *stmt)
296301
/* Make the symlink, if needed */
297302
if (alt_loc)
298303
{
304+
#ifndef WIN32 /* already throws error on WIN32 above */
299305
if (symlink(alt_loc, nominal_loc) != 0)
306+
#endif
300307
elog(ERROR, "CREATE DATABASE: could not link '%s' to '%s': %m",
301308
nominal_loc, alt_loc);
302309
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy