Disable alternate locations on Win32 - Mailing list pgsql-patches

From Bruce Momjian
Subject Disable alternate locations on Win32
Date
Msg-id 200305040443.h444hRi27832@candle.pha.pa.us
Whole thread Raw
Responses Re: Disable alternate locations on Win32  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
The following patch disables alternate locations on Win32 because it
doesn't have symlinks.
--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
Index: src/backend/commands/dbcommands.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/backend/commands/dbcommands.c,v
retrieving revision 1.112
diff -c -c -r1.112 dbcommands.c
*** src/backend/commands/dbcommands.c    4 Apr 2003 20:42:12 -0000    1.112
--- src/backend/commands/dbcommands.c    4 May 2003 04:32:59 -0000
***************
*** 174,179 ****
--- 174,184 ----
      /* 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,302 ****
--- 301,309 ----
      /* 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);
      }

pgsql-patches by date:

Previous
From: Bradley Baetz
Date:
Subject: Re: apply outer->inner join optimisation to OR clauses
Next
From: Joe Conway
Date:
Subject: Re: contrib/tablefunc bugfix