1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-17 17:02:08 +03:00

Change alternate database location patch to test for symlink() rather

than WIN32.
This commit is contained in:
Bruce Momjian
2003-05-07 03:47:08 +00:00
parent 6165a278e5
commit 07d35e4277
4 changed files with 12 additions and 8 deletions

View File

@ -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",