Postgresql Brew



Geoffroy Baumier

I would like to know correct way of starting/stopping postgres database. There are two ways pgctl start/stop service postgresql start/stop I would like to know how they are different from each o.

3 min read

  • $ brew services start postgresql@10 Successfully started `postgresql@10` (label: homebrew.mxcl.postgresql@10) however, no postgresql server is running, but the plist file was copied to /Library/LaunchAgents $ pwd && ls homebrew. /Users/ckhall/Library/LaunchAgents homebrew.mxcl.postgresql@10.plist What you expected to happen.
  • Homebrew calls itself 'the missing package manager for macOS'. It can be used to build and install applications and libraries. Once installed, you can use the brew command to install PostgreSQL and it's dependencies as follows: brew update brew install postgresql Homebrew generally installs.
Postgresql BrewHomebrew postgres

Postgresql Brew Command

Homebrew postgresPostgresql

After upgrading a few programs including postgres when starting a new project, I ran into an issue. I already had some postgres databases from older projects and I couldn't start postgres (and create my new database).

Brew

Feedy. To install postgres with brew I used:

To see if postgres is running I can type:

Then the funny thing was when I tried to start the service:

Great! So it's running! But no.

To see what is the issue, let's look at the logs:

And there was the issue.
All I had to do to fix this was to run this command:

Then let's start it postgres:

Postgresql Brew Install

Now I can see that I have two postgres services with the two different versions. I can create my new updated database. Also the good thing is that I didn't lose any data from previous project and I can run the service with version 12 if I ever need it.