

In your command line, use sudo to execute the following: sudo vim will notice it is a big file. Since the file is protected, you will need to edit it as an admin. psql -c 'SHOW config_file' -d your Postgres config file is located here (on an M1 Mac): let's edit it:

Let's change that.įirst, we need to locate the file, in your command line, type the following in your terminal (If you are not using the latest Postgres 14 or on a Intel based Mac, the location will be different). Step 3: change the default configuration file to speed up your Postgres server.īy default, your newly installed Postgres server is based on a very conservative list of configurations, including some of the most important memory utilization factors which hinder the server's performance. To switch to a different database, use \c You should see something like the following: Postgres is a default database that was installed by default. Psql is a command-line utility that was installed together with the Postgres server, -d specifies which database to connect to. On your command line, type psql -d postgres Step 2.2 check Postgres server installation

Step 2.1 Turn on the Postgres server automatically brew services start postgresqlĮvery time you restart your Mac, the Postgres server will be automatically running in the background. Homebrew will always search for the latest version of a formula as of Nov, 2022, mine is Postgres 14.5 Īfter a few seconds, you should see a success message.
POSTGRESQL MAC TUTORIAL INSTALL
PostgreSQL server brew install postgresql bin/bash -c "$(curl -fsSL )" Step 2: Install the latest Postgresql server. Visit to follow the step-by-step instructions, or copy and paste the following command into your terminal (iTerm 2 you just installed). Homebrew is a great package manager that makes it easy to install and uninstall software (especially for open-source tools) This article will share my approach to installing a Postgres server, upgrading to the latest version, and updating the nf file, which the installation comes with and is way too conservative, it runs lightning fast even on your local laptop.
POSTGRESQL MAC TUTORIAL UPGRADE
In my own experience, things tend to break when you upgrade your macOS, and it is absolutely a nightmare when you need to upgrade Postgre to a new version. The official documentation recommends using the Postgres.dmg file, and I found the process could lead to unnecessary and tedious tasks such as creating a dedicated user. However, there are many different ways to install Postgres on a Mac M1. Introduction: PostgreSQL or Postgres has been one of the most popular relational database engines in the past few years.
