![]() ![]() With a PostgreSQL install and a database created it's time to turn our attention to Django. Now, if you want to access this database via the command line you can use the following command (it's also a nice sanity check): $ psql database_name I assumed this was a command that was run from the PostgresSQL command prompt, but no, it's a shell script: $ createdb database_name So I simply chowned that directory then ran brew postinstall postgresql which got everything working. In my case though, I was getting an error saying could not change permissions of directory "/usr/local/var/postgres": Operation not permitted The command is something like ( NB Homebrew runs this for you, you don't have to): $ initdb /usr/local/var/postgres -E utf8 If you already do, a quick update is always a good idea: $ brew updateĪnd then install PostgreSQL: brew install postgresqlĪs part of that installation script Homebrew will try and run the initial setup for you. If you haven't already got Homebrew installed, explain yourself: $ /usr/bin/ruby -e "$(curl -fsSL )" The postgresql.rb formula here ensures that 9.6.10 is installed, and the. Homebrew will pull in the latest version of formulas when they are upgraded, meaning that users can inadvertently be upgraded to Postgresql 10. In my case: StandardErrorPath /opt/homebrew/var/log/postgresql10.log Look at the log.Open the file and see where the log is written. This path is given by the brew services command. So for my own sanity, here's my back to basics guide for installing and setting up PostgreSQL, creating a database and connecting to it via the command line and Django. This is Clover Healths Homebrew Tap, which features formulas to help pin Postgres to 9.6 and Postgis to 2.5. Check the file /opt/homebrew/opt/postgresql10/. Everyone raves about it and MySQL has lost it's open source cred since being acquired by Oracle.īut I was quickly starting to believe that the reason people were raving about it (particularly Python and Ruby folk) was simply because they were just so proud of themselves for having managed to set it up locally. I've been keen to start using PostgreSQL for far too long now. ![]()
0 Comments
Leave a Reply. |