Open source RDBMS (relational database management system) when used in conjunction with the Ruby on Rails framework.
0
votes
1answer
39 views
Get all data from all tables (Postgresql)
data = Program.joins(:program_schedules, :channel).
where(
"program_schedules.start" => options[:time_range],
"programs.ptype" => "movie",
...
0
votes
3answers
80 views
Postgresql adapter (pg): could not connect to server
I get this error every this I run my Rails app (It cannot connect to my local Postgresql)
/Users/leonardo/.rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.11/lib/
...
0
votes
0answers
27 views
PostgreSQL rake db:create Error in local environment
I continue to run into issues whenever I use postgreSQL for Rails app development in my local environment.
I'm running on Mac OS X 10.7. I'm aware this version comes with a pre-installed Postgres ...
0
votes
4answers
40 views
How can I sort a list of ActiveRecords by an attribute length?
I have an object like this:
irb(main):076:0> hints = Hint.where("sentence LIKE ?","%你%")
Hint Load (4.0ms) SELECT "hints".* FROM "hints" WHERE (sentence LIKE '%你%')
[
[0] ...
2
votes
2answers
27 views
How to manage the wals dir on a PostgreSQL replication server?
I have two PostgreSQL 9 servers running on Amazon EC2. One is the master, the other is a replication server in standby.
The replication server is continuing to fail as the hard drive fills up. It ...
0
votes
1answer
58 views
Rails string array and PostgreSQL
I have a Rails model named Container with a column named products. It is a string array as supported by Postgres and the 'postgres_ext' gem.
The relevant portion of the GEMFILE is:
gem 'rails', ...
4
votes
3answers
71 views
Millisecond resolution of DateTime in Ruby
I have a string like 2012-01-01T01:02:03.456 that I am storing in a Postgres database TIMESTAMP using ActiveRecord.
Unfortunately, Ruby seems to chop off the milliseconds:
ruby-1.9.3-rc1 :078 > ...
1
vote
0answers
24 views
How to find a set of missing dates in a table from date range query
There are some stackoverflow posts related to my question but not all that similar.
I would like an efficient and somewhat elegant(if possible) solution as to get an array of missing dates after ...
0
votes
0answers
17 views
Postgresql query
I have two tables one is user and other is projects with one to many relationship between two.
Project table has field "status" where i am defining project statuses of the user.
Statues are as ...
1
vote
2answers
87 views
Get “latest” row after GROUP BY over multiple tables
I'd preferably like to first query listed below and just group by stories.id, but I get the following error:
ERROR: column "u.first_name" must appear in the GROUP BY clause or be used in an ...
0
votes
0answers
43 views
Use pgbackups dump to selectively restore to heroku db
I have a dump filed generated from pgbackups and I want to use some of the data in it to populate a new database on heroku. It's not a simple restore.
I want to use the -t option from pg_restore and ...
0
votes
1answer
69 views
Trying to get postres and postgis running in rails app
I am completely new to Postgresql, Postgis, and SQL and have a little bit of rails knowledge. I am trying to get an existing app going on my local and am currently receiving the following messages ...
1
vote
1answer
29 views
Grouping a timestamp field by date in Ruby On Rails / PostgreSQL
I am trying to convert the following bit of code to work with PostgreSQL.
After doing some digging around I realized that PostgreSQL is much stricter (in a good way) with the GROUP BY than MySQL but ...
0
votes
0answers
51 views
First time Postgres setup Rails 2.3 App
I am a newb and just installed postrgresql and postgis and am having issues getting it to work. I am being asked for a username and password when running a rake task I have created to setup postgis ...
1
vote
1answer
42 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 = ...