Configure Postgresql for my Rails Application
Hi there, This post I want to write as a log of my success on configuring Postgresql database to production for my Rails application. 
Let’s get started. I’ve installed Postgresql 8.4 through apt-get.
The first step I do is to change the password of ‘postgres’ user.
Run the command on root shell.
passwd postgres
And I usually allow remote access into my Postgresql database. So, I have to edit the file ‘/etc/postgresql/8.4/main/pg_hba.conf’ by seeing this line.
local all all ident
and change it to…
local all all md5
Then restart the service.
/etc/init.d/postgresql-8.4 restart
The second step I usually do is to install the admin pack.
su - postgres psql template1 < /usr/share/postgresql/8.4/contrib/adminpack.sql psql -d template1 -c "ALTER USER postgres WITH PASSWORD 'newpassword';"
The next step is to create a new database and user to be used by your application. Assume the application is named ‘Social Dating’.
createdb socialdatingdb createuser socialdatinguser --pwprompt psql socialdatingdb GRANT ALL TO socialdatinguser
Then you can test CRUD on the database with…
psql -U socialdatinguser -W socialdatingdb
Enjoy Postgresql!
Please share this page to anyone who think it is helpful for them.
Archives
- November 2011
- October 2011
- September 2011
- August 2011
- July 2011
- June 2011
- May 2011
- March 2011
- February 2011
- January 2011
- September 2010
- August 2010
- July 2010
- June 2010
- May 2010
- April 2010
- January 2010
- December 2009
- October 2009
- August 2009
- July 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- June 2007
Tags
.net 2008 asp.net asp.net mvc asus eee c# corona cpa doctrine dom eee eee pc Internet Marketing ios iPad iphone iPhone development iphone sdk javascript make money netbook online marketing pagerank passion php playstation playstation 3 ps3 ranking ror ruby on rails self help Self Improvement self motivation seo sql success symfony take action the secret ultra compact laptop ultra compact notebook vb.net web development wordpress




