1. Knowledge Base
  2. Admin
  3. Database Administration

How do I stop the PostgreSQL service on a Mac?

When installing xTuple ERP on a Mac, you may run into an issue if you have a previous instance of PostgreSQL running. If you get an error message during the installation that says:

"There has been an error. There is not enough shared memory. PostgreSQL component requires a minimum shared memory segment of 32MB. Please increase "shmmax" kernel parameter (in /etc/sysctl.conf) or close any other PostgreSQL instances before restarting installation."

You can use the Terminal application on Mac OS X to run commands to stop the database service. You'll give yourself Superuser privileges, then switch yourself to the postgres user, then stop the service.

  1. Make sure you've closed all connections to the postgres database, such as pgAdmin or xTuple.
  2. Go to Terminal (It's in Applications/Utilities)
  3. Type: sudo su -
  4. Enter the password you use to login to your Mac
  5. Type: cd /Applications/xTuple/postgresql/bin/ (assuming you installed xTuple in the default directory. If not, you'll need to change the path to where you installed it).
  6. Type: sudo -u postgres ./pg_ctl -D /Applications/xTuple/postgresql/data stop
  7. You can start up the database in the same way, using the start command: sudo -u postgres ./pg_ctl -D /Applications/xTuple/postgresql/data start