Bad UI design: pg_ctl and data_directory

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Bad UI design: pg_ctl and data_directory
Дата
Msg-id 4DE6994C.7010604@agliodbs.com
обсуждение исходный текст
Ответы Re: Bad UI design: pg_ctl and data_directory  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
All,

pg_ctl -D means different things depending on whether you are calling
"start" or "stop".  For "start", pg_ctl wants the directory
postgresql.conf is in, and for "stop" it wants the directory
postmaster.pid is in.  This means that if your .conf files are not in
the same directory as data_directory, you have to write special-case
code for start and stop.

Given that having the .conf files in /etc is the default configuration
for both Red Hat and Debian, this seems like really poor UI design on
our part.  Also, it makes the "data_directory" parameter somewhat
disingenous, because effectively that parameter doesn't work all the time.

It actually seems relatively easy to fix this without breaking
backwards-compatibility.  We should add this logic to "pg_ctl stop":

1) if postmaster.pid is in -D, shut down that pid.
2) if postmaster.pid is not in -D, look for postgresql.conf
3) if postgresql.conf is found, look in data_directory for postmaster.pid

This would end the pg_ctl breakage on our most popular platforms, while
not changing any functionality for those already installed.  Objections?

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: [BUGS] BUG #6034: pg_upgrade fails when it should not.
Следующее
От: Florian Pflug
Дата:
Сообщение: Re: [BUGS] BUG #6034: pg_upgrade fails when it should not.