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.
--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general