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 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. 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. Install Rosetta Homebrew ❯ arch -x86_64 zsh -c "$(curl -fsSL )"Īll Homebrew related stuffs are in /usr/local.Ĭonfiguring ~/.Introduction: PostgreSQL or Postgres has been one of the most popular relational database engines in the past few years. Install Native Homebrew ❯ arch -arm64 zsh -c "$(curl -fsSL )"Īll Homebrew related stuffs are in /opt/homebrew. If you prefer Intel to be the default brew, add /opt/homebrew/bin to the end of your PATH instead of the beginning. zshrc ( alias ib='PATH=/usr/local/bin') so I can prepend any Homebrew-installed command with ib to force using the Intel version of that command: ~ ▶ which youtube-dl To override, run the command with its full path ( /usr/local/bin/youtube-dl), or override your PATH for one command ( PATH=/usr/local/bin youtube-dl). If you have the same command installed in both Homebrews, it'll default to Apple Silicon ( /opt/homebrew/) since we prepended that one in our PATH. Which brow should return brow: aliased to arch -x86_64 /usr/local/Homebrew/bin/brew Which brew should return /opt/homebrew/bin/brewīrew -prefix should return /opt/homebrew If you're still on bash it'd be PATH=/opt/homebrew/bin:$PATH In ~/.zshrc (or your shell's equivalent) add: # Homebrew on Apple Silicon In ~/.zshrc (or your shell's equivalent) add: alias brow='arch -x86_64 /usr/local/Homebrew/bin/brew' If you haven't yet installed Rosetta 2, you'll need to run softwareupdate -install-rosetta first.Ĭreate an alias for Intel homebrew. Install Intel-emulated Homebrew (will install to /usr/local by default): arch -x86_64 /bin/bash -c "$(curl -fsSL )" Install Homebrew natively on Apple Silicon (will install to /opt/homebrew by default): /bin/bash -c "$(curl -fsSL )"
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |