I am going to use thinking sphinx for my application and it requires a conversion to postgresql. I have downloaded both sphinx and postgresql using homebrew, but I am unsure how to convert the rest of the application. I do not care about saving my data, as I only have about 5 records in my database. If there is a step by step guide, or a resource that could guide me I would appreciate it.
Asked
Active
Viewed 3,661 times
3 Answers
5
It's a very simple process if you have stuck to using activerecord and not used any custom SQL.
All you'll need to do is change your gemfile to include gem 'pg'
and change the database.yml file to have something like the following:
development:
adapter: postgresql
database: example_development
username: postgres
password: secret
host: localhost
encoding: UTF8
If you have used custom SQL, you'll just need to convert it to PostgreSQL, which shouldn't be too tricky as it's very similar.

sren
- 3,513
- 4
- 25
- 28
-
What about the database line, what do I write for that? – tomciopp Oct 09 '11 at 22:24
-
drop your existing database and recreate it (using rake db commands) after making changes as suggested by Simon. – rb512 Oct 09 '11 at 22:31
-
I keep getting password errors, which doesn't make sense to me as I am providing the correct password to sign in to postgresql. I created a new app using postgresql on my system and it ran perfectly. I looked at the database.yml file and it was slightly different than the one provided, copied that format and it still didnt work. Any suggestions? – tomciopp Oct 09 '11 at 23:44
-
I've updated the example above to include the exact things you'll need to provide. Are you sure you can access login to psql with the exact same `username` and `password` settings as the yml file has? – sren Oct 10 '11 at 09:17
1
I used the following video from Peter Cooper to figure out what I was doing wrong. If anyone needs to set up Postgresql in the future reference this: http://www.youtube.com/watch?v=pf5jPUJAeU4

tomciopp
- 2,602
- 2
- 31
- 60