[review] PostgreSQL Service on Windows does not start if data directory given is relative path

From: "MauMau" <maumau307(at)gmail(dot)com>
To: "Rajeev rastogi" <rajeev(dot)rastogi(at)huawei(dot)com>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: [review] PostgreSQL Service on Windows does not start if data directory given is relative path
Date: 2014-02-01 00:32:34
Message-ID: 1E531D66A45A4F8E94896B65A044D929@maumau
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Rajeev san,

I reviewed the patch content. I find this fix useful.

I'd like to suggest some code improvements. I'll apply and test the patch
when I receive your reply.

(1)
I think it is appropriate to place find_my_abs_path() in path.c rather than
exec.c. Please look at the comments at the beginning of those files.
exec.c handles functions related to executables, while path.c handles
general functions handling paths.

It's better to rename the function to follow the naming of other functions
in path.c, something like get_absolute_path() or so. Unfortunately, we
cannot use make_absolute_path() as the name because it is used in
src/backend/utils/init/miscinit.c, which conflicts in the backend module.

(2)
In pg_ctl.c, dbpath can be better named as datadir, because it holds data
directory location. dbpath is used to mean some different location in other
source files.

(3)
find_my_abs_path() had better not call make_native_path() because the role
of this function should be to just return an absolute path. pg_ctl.c can
instead call make_native_path() after find_my_abs_path().

(4)
find_my_abs_path() should not call resolve_symlinks(). For reference, look
at make_absolute_path() in src/backend/utils/init/miscinit.c and
src/test/regress/pg_regress.c. I guess the reason is that if the user
changed to the directory through a symbolic link, we should retain the
symbolic link name.

(5)
Change "file/path" in the comment of find_my_abs_path() to "path", because
file is also a path.

Regards
MauMau

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2014-02-01 01:22:22 Re: Compression of full-page-writes
Previous Message Bruce Momjian 2014-01-31 23:38:29 Re: Redesigning checkpoint_segments