I am learning how to install and use PostgreSQL server and I have run across a few different tutorials. One of them had me running
When I realized that I probably just don't have /usr/local/etc/rc.d in PATH, I stopped the server using
These two coommands seemed to do the same thing (building /usr/local/pgsql/data database) except the log is in a different place.
So, my question is: which of these methods makes the most sense? Does the /usr/local/etc/rc.d/postgresql method do more "magic" in the background that I should rely on? I was also worried about the server starting after a reboot; does this work for any databases I've started?
Thank you,
-gns
postgresql
commands from /usr/local/etc/rc.d. However, I initially didn't see the directory and the command wasn't working so I ended up finding pg_ctl
and doing the following: pg_ctl initdb -D data
pg_ctl -D data -l logs/pgsql-data.log start
When I realized that I probably just don't have /usr/local/etc/rc.d in PATH, I stopped the server using
pg_ctl stop -D data
, rm -r data/
. (All of these commands thus far were done under pgsql user.) I then went into root and did: /usr/local/etc/rc.d/postgresql initdb
/usr/local/etc/rc.d/postgresql start
These two coommands seemed to do the same thing (building /usr/local/pgsql/data database) except the log is in a different place.
So, my question is: which of these methods makes the most sense? Does the /usr/local/etc/rc.d/postgresql method do more "magic" in the background that I should rely on? I was also worried about the server starting after a reboot; does this work for any databases I've started?
Thank you,
-gns