Re: Disable alternate locations on Win32

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Disable alternate locations on Win32
Date: 2003-05-05 16:25:23
Message-ID: 200305051625.h45GPN714417@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > The following patch disables alternate locations on Win32 because it
> > doesn't have symlinks.
>
> Why not do it with one ifdef in one place?

It was done this way because they wanted to test earlier for failure,
and they didn't want the symlink call because they didn't have symlinks.
I didn't totally follow the code.

> if (alt_loc)
> {
> + #ifndef WIN32
> if (symlink(alt_loc, nominal_loc) != 0)
> elog(ERROR, "CREATE DATABASE: could not link '%s' to '%s': %m",
> nominal_loc, alt_loc);
> + #else
> + elog(ERROR, "CREATE DATABASE: may not use an alternate location on this platform");
> + #endif
> }
>
> Also I wonder if this shouldn't be conditionalized on something like
> HAVE_SYMLINKS rather than a hardwired platform check.

Yes, that would be better.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Magnus Naeslund(f) 2003-05-05 16:45:59 Re: Patch for PGunescapeBytea
Previous Message Greg Sabino Mullane 2003-05-05 15:57:03 Add pg_catalog to pltcl code