Re: pg_ctl -D canonicalization

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Magnus Hagander <mha(at)sollentuna(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: pg_ctl -D canonicalization
Date: 2004-10-27 00:43:13
Message-ID: 200410270043.i9R0hDC06951@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Magnus Hagander wrote:
> It seems pg_ctl calls canonicalize_path() only on the path as being used
> to access for example the pid file, and not the path that is sent along
> to the postmaster.
> Specifically, this causes failure on win32 when a path is passed with a
> trailing backslash, when it's inside quotes such as:
> pg_ctl start -D "c:\program fiels\postgresql\data\"
>
> The quotes are of course necessary since there are spaces in the
> filename. In my specific case the trailing backslash is automatically
> added by windows installer. but other cases when the backslash is added
> can easily be seen...
>
> Attached patch makes pg_ctl call canonicalize_path() on the path as
> passed on the commandline as well.
>
> I have only tested this on win32, where it appears to work fine. I think
> it would be good on other platsforms as well which is why I didn't
> #ifdef it. If not, then please add #ifdefs.

Uh, isn't the proper fix to fix the postmaster's handling of -D paths?

--
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

Browse pgsql-patches by date

  From Date Subject
Next Message Neil Conway 2004-10-27 01:20:50 pgstat cleanup: use palloc and AllocateFile
Previous Message Josh Berkus 2004-10-27 00:39:59 Re: [PERFORM] [PATCHES] ARC Memory Usage analysis