aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/postgresql.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Formula/postgresql.rb')
-rw-r--r--Library/Formula/postgresql.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/Library/Formula/postgresql.rb b/Library/Formula/postgresql.rb
index 791b87257..8d540ecab 100644
--- a/Library/Formula/postgresql.rb
+++ b/Library/Formula/postgresql.rb
@@ -68,12 +68,14 @@ class Postgresql < Formula
system "make install-world"
end
+ def post_install
+ unless File.exist? "#{var}/postgres"
+ system "#{bin}/initdb", "#{var}/postgres", '-E', 'utf8'
+ end
+ end
+
def caveats
s = <<-EOS.undent
- initdb #{var}/postgres -E utf8 # create a database cluster
- postgres -D #{var}/postgres # serve that database
- PGDATA=#{var}/postgres postgres # …alternatively
-
If builds of PostgreSQL 9 are failing and you have version 8.x installed,
you may need to remove the previous version first. See:
https://github.com/mxcl/homebrew/issues/issue/2510
@@ -94,7 +96,7 @@ class Postgresql < Formula
EOS
end
- plist_options :manual => "pg_ctl -D #{HOMEBREW_PREFIX}/var/postgres -l #{HOMEBREW_PREFIX}/var/postgres/server.log start"
+ plist_options :manual => "postgres -D #{HOMEBREW_PREFIX}/var/postgres"
def plist; <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>