1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to start/stop and disable auto-startup of Postgres on Mac via UI?

Discussion in 'Programming/Internet' started by John Little, Oct 8, 2018.

  1. John Little

    John Little Guest

    Well, I am stumped. I installed postgres via the oficial installer here: https://www.postgresql.org/download/macosx/

    I can run pgadmin III and connect to my DB.

    The problem is I need to frequently stop and start it (as it conflicts with docker containers).

    How do you start and stop postgres on a Mac, installed with the official installer, via UI?

    I spent some time looking for an answer, and found none which work. The pgadmin documentation here says "pgAdmin will check if the service is running, and allows to start and stop the service." But no mention of how. I have spent some time scouring the pgpadmin UI and I cant find where to start/stop (and ideally switch on/off autostart) the connected local database.

    Assuming noone has developed a simple start/stop function for postgres, i next tried to figure out how to do this on the command line.

    The official documentation does not have the answers (for Mac).

    For stopping, the documentation says to do this: kill -INT head -1 /usr/local/pgsql/data/postmaster.pid but that file does not exist (on Mac at least).

    For starting, it says postgres -D /usr/local/pgsql/data or this: /usr/local/pgsql/bin/pg_ctl start -l logfile -D /usr/local/pgsql/data

    Neither of which works. there is no documentation for Mac.

    Googling, I tried most of the hits for how to stop and start postgres on the mac. All fail. The main issue is that pg_admin nor postgress are on the machine.

    E.g. this post: https://gist.github.com/kingbin/9435292

    Says to do this:

    $ sudo su postgres
    Password:
    bash-3.2$ pg_ctl -D /Library/PostgreSQL/9.3/data/ stop
    waiting for server to shut down.... done


    But I just get pg_ctl not found.

    If I do which postgres or which pg_ctl neither are found, even if I sudo su - postgres before hand.

    So far I have spent a day looking for an official documented (or, more recently any) way to start/stop postgres, and drawn a blank. how can it be this hard? I have been using Oracle and mySsql for 20 years, and have never had this kind of difficultly.

    What I also need to do is enable and disable the auto-start on boot. Ideally via UI tool. Has anyone found something like this?

    Login To add answer/comment
     

Share This Page