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

Поиск
Список
Период
Сортировка
От MauMau
Тема [review] PostgreSQL Service on Windows does not start if data directory given is relative path
Дата
Msg-id 1E531D66A45A4F8E94896B65A044D929@maumau
обсуждение исходный текст
Ответы Re: [review] PostgreSQL Service on Windows does not start if data directory given is relative path  (Rajeev rastogi <rajeev.rastogi@huawei.com>)
Список 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




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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Redesigning checkpoint_segments
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Compression of full-page-writes