Re: Finding the bin path

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: Finding the bin path
Дата
Msg-id 4B37F93A.6040709@hogranch.com
обсуждение исходный текст
Ответ на Re: Finding the bin path  (Rob Jaeger <yogirob@gmail.com>)
Список pgsql-general
Rob Jaeger wrote:
> I was not clear in my initial question. I need to access the
> pg_dump.exe and pg_restore.exe files from within a c++ program. I
> can't execute pg_config.exe because it's in that bin that I'm seeking.
>
> I don't quite follow Greg Smith's reply of 'try guess based on "which
> postmaster"' (can you clarify?)
>

    $ which postmaster
    /usr/bin/postmaster


the which command on most unix platforms searches the PATH

> But - I think I have found what I need! I can do a "SHOW
> data_directory;" and then from there I can snoop inside the
> postmaster.opts file to get the bin path. The question I have now is -
> is this method safe? Is this file present in all platform data
> directories. (I'm using Win7)

its there on a RHEL/CentOS/Fedora default install...

    $ more $PGDATA/postmaster.opts
    /usr/bin/postgres "-p" "5432" "-D" "/var/lib/pgsql/data"


the one I'd be worried about would be a debian/ubuntu install as they
move stuff around all over the place and can support several concurrent
installations.



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

Предыдущее
От: Rob Jaeger
Дата:
Сообщение: Re: Finding the bin path
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: Finding the bin path