Because I began using a newer computer this summer, I had not yet installed PostgreSQL. So I pulled up a previous post about installing PostgreSQL using MacPorts and did some searches to find the latest PostgreSQL. Below are the commands I ran.
First, I needed to figure out what the latest version of PostreSQL is in MacPorts:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo port search postgresql | grep '^postgresql\d\d' | |
postgresql80 @8.0.26 (databases) | |
postgresql80-doc @8.0.26 (databases) | |
postgresql80-server @8.0.26 (databases) | |
postgresql81 @8.1.23 (databases) | |
postgresql81-doc @8.1.23 (databases) | |
postgresql81-server @8.1.23 (databases) | |
postgresql82 @8.2.23 (databases) | |
postgresql82-doc @8.2.23 (databases) | |
postgresql82-server @8.2.23 (databases) | |
postgresql83 @8.3.23 (databases) | |
postgresql83-doc @8.3.23 (databases) | |
postgresql83-server @8.3.23 (databases) | |
postgresql84 @8.4.22 (databases) | |
postgresql84-doc @8.4.22 (databases) | |
postgresql84-server @8.4.22 (databases) | |
postgresql90 @9.0.18 (databases) | |
postgresql90-doc @9.0.18 (databases) | |
postgresql90-server @9.0.18 (databases) | |
postgresql91 @9.1.14 (databases) | |
postgresql91-doc @9.1.14 (databases) | |
postgresql91-server @9.1.14 (databases) | |
postgresql92 @9.2.9 (databases) | |
postgresql92-doc @9.2.9 (databases) | |
postgresql92-server @9.2.9 (databases) | |
postgresql93 @9.3.5 (databases) | |
postgresql93-doc @9.3.5 (databases) | |
postgresql93-server @9.3.5 (databases) | |
postgresql94 @9.4beta2 (databases) | |
postgresql94-doc @9.4beta2 (databases) | |
postgresql94-server @9.4beta2 (databases) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo port install postgresql94 postgresql94-server postgresql94-doc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo mkdir -p /opt/local/var/db/postgresql94/defaultdb | |
$ sudo chown postgres:postgres /opt/local/var/db/postgresql94/defaultdb | |
$ sudo su postgres -c '/opt/local/lib/postgresql94/bin/initdb -D /opt/local/var/db/postgresql94/defaultdb' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ printf '%s\n\n%s' '#!/bin/bash' 'su postgres -c "/opt/local/lib/postgresql94/bin/pg_ctl -D /opt/local/var/db/postgresql94/defaultdb -l /opt/local/var/db/postgresql94/defaultdb/postgresql.log start"' > ~/bin/pg_start.sh | |
$ chmod +x ~/bin/pg_start.sh | |
$ printf '%s\n\n%s' '#!/bin/bash' 'sudo su postgres -c "/opt/local/lib/postgresql94/bin/pg_ctl -D /opt/local/var/db/postgresql94/defaultdb stop"' > ~/bin/pg_stop.sh | |
$ chmod +x ~/bin/pg_stop.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo tail -f /opt/local/var/db/postgresql94/defaultdb/postgresql.log |
No comments:
Post a Comment