3
votes
2answers
4k views

Rails - Postgres - could not connect to server: Connection refused (PG::ConnectionBad)

Yesterday I've install Postgres and pgAdminIII, all worked correctly, but after reload it stopped working. After rails server I've got error message: => Booting Thin => Rails 3.2.13 application ...
2
votes
1answer
386 views

Rails 3: Would PostgreSQL be a better fit than MySQL for partitioning tables?

Is Postgres a better option than MySQL for partitioning tables by date? How well does Postgres play with Rails and when it comes to partitioning tables? The purpose of my application will be to ...
1
vote
1answer
112 views

Postgres: average user response time from interaction with a bot

I have a table that stores all messages between users and a bot (basically a state machine), and I'm trying to find all pairs of message/response from this table, in order to calculate each user's ...
1
vote
1answer
146 views

RoR: 'rake db:seed' takes two hours

I have a problem. The command 'rake db:seed' takes two hours because myfriends.txt has over 3 Miliionen entries: File.open("lib/friends_name/myfriends.txt", "r").each_line do |row| row = ...
1
vote
0answers
87 views

Active Record: Add metadata to attributes

I got the following problem: I have a rails4 application with a postgresql. The database contains data that is imported from different sources. These sources have different priorities (or ...
1
vote
0answers
263 views

heroku pg:transfer - receiving error during upload of postgresql db

I am trying to upload my local database to production and I keep running into the following error while processing: $ heroku pg:transfer --from postgres://username:password@localhost/blog_develo ...
0
votes
1answer
15 views

DB query from a belongs_to relationship

I have a model: Animal belongs_to :owner I have a model: Owner has_many :animals Owner has a boolean attribute active def self.not_active where('owner.active == ?', false) end The above ...
0
votes
0answers
77 views

Rails how to implement hierarchical associations

Is there a Rails way to implement hierarchical associations? I'm currently trying to map below layout fields in database: Product -> Product URL -> No Link -> ...
0
votes
0answers
52 views

“Internal error” thrown by Rails to SQL conversion for query

Rails is throwing in "INTERNAL ERROR" when I try to run a particular query, does anyone have an idea how to resolve this? XYZ and ALongString are obfuscations since this is related to my work. ...
0
votes
0answers
413 views

Using Sqlite3 test database and Postgres dev/production database in Rails

I currently have a rails project which I deploy to a production server which uses a postgres database. I develop my rails project in Windows, which means that if I want to test locally, I have to ...
0
votes
1answer
200 views

Rails Heroku database missing data

I'm new to Rails and Heroku. I don't partly understand system of databases (testing, production, development). I created two Rails apps. First with Rails' default sqlite db and second with ...