Brew Postgresql Start



Brew start postgresql

Postgres

This installation process is from MONCEF BELYAMANI

Uninstall postgresql $ brew uninstall postgresql brew uninstall postgresql@10 but because I have postgis installed (a dependecny) I have to run the command $ brew uninstall –ignore-dependencies postgresql. Brew install postgresql@9.6 brew services start postgresql@9.6 brew link postgresql@9.6 –force. Brew services start. After successfully installing postgresql@10 formulae via brew install postgresql@10, i then attempted to start postgresql using brew services start postgresql@10. $ brew services start postgresql@10 Successfully started `postgresql@10` (label: homebrew.mxcl.postgresql@10). Once Homebrew is installed, you can install PostgreSQL by issuing the following commands in your terminal: $ brew update $ brew doctor $ brew install postgres The first two commands are used to update Homebrew and report any potential issues (if necessary). Then, of course, brew install postgres is the one-line command for installing PostgreSQL. Have you tried: brew services start postgresql? – Chessbrain Jul 16 '19 at 14:02 By logs provided by you i think you have delete pgtblspc and pgreplslot directory from data-diectory of postgresql 11.4 kindly put back those if you can't recover just create it using mkdir pgtblspc with postgres user permission and start again – Ashiq.

This is a quick guide for installing PostgreSQL (Postgres for short) on a Mac with Homebrew, and starting and stopping it with Lunchy. If you've just forked a Ruby on Rails project that requires Postgres, this tutorial will get you up and running in no time.

If you're working on a brand new Rails app and need to create a new Postgres user and database for your app, I recommend Will Jessop's tutorial or Peter Cooper's screencast.

Step 1: Install Homebrew

To make sure you have all the tools necessary for Ruby on Rails development, I recommend you follow my tutorial for installing Xcode, Homebrew, Git, RVM, and Ruby on a Mac.

Step 2: Update Homebrew

Before you install anything with Homebrew, you should always make sure it's up to date and that it's healthy:

Step 3: Install Postgres

Brew Postgresql Start

When you install Postgres, you will see a bunch of output in your Terminal that looks like this:

The important sections are Build Notes, Create/Upgrade a Database, and Start/Stop PostgreSQL. Make sure to follow those instructions to the letter.

Step 4: Create/Upgrade a database

If this is your first time installing Postgres with Homebrew, you'll need to create a database with:

I copied and pasted that command directly from the Terminal output. You should do the same, in case the instructions change in the future.

Step 5: Install Lunchy

Lunchy is a helpful gem that will allow you to easily start and stop Postgres.

Start

Step 6: Start/Stop Postgres

Once again, I'm copying and pasting the following commands from my Terminal. Note that the second command is specific to the version of Postgres that was installed on my machine. If the version number has changed since I've written this tutorial, using the command below won't work for you, so you should make sure to copy the command from your Terminal output.

Since we're using Lunchy, we don't need to run this third command:

Instead, we'll simply use this to start Postgres:

At this point, you should be all set to run the rake commands to create and use the database for the existing Rails app you're working on.

To stop Postgres:

This article was last updated on November 19, 2020

Guide

This is a quick guide for installing PostgreSQL (Postgres for short) on a Mac with Homebrew, and starting and stopping it with Homebrew Services. If you're working on a Ruby on Rails project that requires Postgres, this tutorial will get you up and running in no time.

The easiest way to install Homebrew, Postgres, and all the othertools necessary for Ruby on Rails development, is to run my free script that will set everything up for you.

Homebrew Install Postgres

If you prefer to do things manually and hope for the best, follow the steps below.

Step 1: Install Homebrew

Follow the instructions on their site.

Step 2: Update Homebrew

Before you install anything with Homebrew, you should always make sure it's up to date and that it's healthy:

Homebrew Postgres

Step 3: Install Postgres

Brew Postgres

When you install Postgres, Homebrew will provide useful information in your Terminal that you should read. Homebrew also helpfully creates a default database cluster. You can confirm that if you see the following output:

Step 5: Start the Postgres service

Brew Postgresql Start Page

At this point, you should be all set to run the Rails commands to create and use the database in your app.

Brew Postgres Start Service

To stop Postgres:

To see a list of all services and their state: