Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PostgreSQL installation fails with macOS Big Sur(M1)

I am struggling to install PostgreSQL on my macOS Big Sur with M1 chip. These are the message I get when I try to install PostgreSQL in the last step. I tried installing version 12, 11, 10. Anyone knows how to solve this problem?

  • A non-fatal error occur whilst creating menu shortcuts.
  • Problem running post-install step. Installation may not complete correctly Failed to start the database server.
like image 383
Penguin Avatar asked Feb 05 '21 10:02

Penguin


People also ask

How do I know if PostgreSQL is installed on my Mac?

psql -c "SELECT 1" -d {dbname} > /dev/null || postgres -D /usr/local/var/postgres >postgres. log 2>&1 & if you want to check and start postgres in one go (handy for automation scripts).

Does PostgreSQL work on Mac?

MacPorts. PostgreSQL packages are also available for macOS from the MacPorts Project. Please see the MacPorts documentation for information on how to install ports. A list of PostgreSQL packages can be found using the portfiles search tool on the MacPorts website.


1 Answers

There is a permissions issue produced by Big Sur sec policies. https://pgsnake.blogspot.com/2020/11/macos-big-sur-upgrade-breaking.html

This will happen if you're installing in the default location, which in this case is Library. I was struggling with this for a few days and found that if I define my own installation path not located in the Library folder(say some folder in my Desktop), I was able to install without issue.

Give that a try and see if it works for you.

Edit: Be sure to delete all previous failed installations if any exist.

like image 57
Samuel Norman Avatar answered Nov 29 '22 16:11

Samuel Norman