Postgres in Yosemite

I have just updated to Yosemite and my worst fears have come true. The first problem that I have faced so far is running postgres. As soon as I try to start rails server, I get this error:

 
"could not connect to server: Connection refused (PG::Error)"

So, it is clear that my postgres server is not running yet. So when I try to start postgres by this command:

postgres -D /usr/local/var/postgres/

The error I am getting is this:

 
"FATAL:  could not open directory "pg_tblspc": No such file or directory"

After doing some research on internet, I found that these are indeed directories under /usr/local/var/postgres/

So now I look for this file or directory under /usr/local/var/postgres/, but no such file or directory exists. So I create this directory under the path as:

 
mkdir /usr/local/var/postgres/pg_tblspc

And now when I try to start the server, I get a new error:

FATAL:  could not open directory "pg_twophase": No such file or directory

So again after looking for this file/directory, since it does not exists, I created the directory:

mkdir /usr/local/var/postgres/pg_twophase

And now when I try to start the server, I get a new error:

LOG:  could not open temporary statistics file "pg_stat_tmp/global.tmp": No such file or directory

So I create this directory also:

mkdir /usr/local/var/postgres/pg_stat_tmp

And finally the postgres server starts. Yayyy…!!!

Advertisements

One thought on “Postgres in Yosemite

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s