aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2003-05-07 03:47:08 +0000
committerBruce Momjian <bruce@momjian.us>2003-05-07 03:47:08 +0000
commit07d35e4277da141475793cc67c373183ecd71453 (patch)
treedeadaf1f4015413e9a2252901708760d537138c8 /src
parent6165a278e52046de6e6c9ccf854566b6a1e22f0f (diff)
downloadpostgresql-07d35e4277da141475793cc67c373183ecd71453.tar.gz
postgresql-07d35e4277da141475793cc67c373183ecd71453.zip
Change alternate database location patch to test for symlink() rather
than WIN32.
Diffstat (limited to 'src')
-rw-r--r--src/backend/commands/dbcommands.c8
-rw-r--r--src/include/pg_config.h.in3
2 files changed, 7 insertions, 4 deletions
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c
index 6a680bc1a19..1c3b554c291 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.113 2003/05/04 04:42:52 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.114 2003/05/07 03:47:08 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -174,8 +174,8 @@ 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 */
+#ifndef HAVE_SYMLINK
+ if (dbpath != NULL)
elog(ERROR, "CREATE DATABASE: may not use an alternate location on this platform");
#endif
@@ -301,7 +301,7 @@ createdb(const CreatedbStmt *stmt)
/* Make the symlink, if needed */
if (alt_loc)
{
-#ifndef WIN32 /* already throws error on WIN32 above */
+#ifdef HAVE_SYMLINK /* already throws error above */
if (symlink(alt_loc, nominal_loc) != 0)
#endif
elog(ERROR, "CREATE DATABASE: could not link '%s' to '%s': %m",
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index b54b6f9d2a0..838abafffc6 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -414,6 +414,9 @@
/* Define to 1 if you have the <SupportDefs.h> header file. */
#undef HAVE_SUPPORTDEFS_H
+/* Define to 1 if you have the `symlink' function. */
+#undef HAVE_SYMLINK
+
/* Define to 1 if you have the `sysconf' function. */
#undef HAVE_SYSCONF