Re: Disable alternate locations on Win32

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Disable alternate locations on Win32
Дата
Msg-id 200305051625.h45GPN714417@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: Disable alternate locations on Win32  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Disable alternate locations on Win32  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-patches
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.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@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


В списке pgsql-patches по дате отправления:

Предыдущее
От: "Greg Sabino Mullane"
Дата:
Сообщение: Add pg_catalog to pltcl code
Следующее
От: "Magnus Naeslund(f)"
Дата:
Сообщение: Re: Patch for PGunescapeBytea