Questions tagged [rails-postgresql]

Open source RDBMS (relational database management system) when used in conjunction with the Ruby on Rails framework.

PostgreSQL is an open source object-relational database system that has the features of traditional proprietary database systems with enhancements to be found in next-generation DBMS systems. PostgreSQL is free and the complete source code is available.

This tag should be used for questions about using PostgreSQL within the Ruby on Rails framework, particularly where the solution desired is to be done "the Rails way" as opposed to directly mucking around in SQL and the like.

485 questions
-1
votes
1 answer

How to compare dates across two tables where one date is valid until updated?

I have a relatively complicated query to write; we use Postgres. Basically, I have data across two tables: Table 1: Historical ticket prices ticket_seller_id | show_id | low_price | created_at 1 | 17 | 40 |…
-1
votes
1 answer

Ruby on Rails: must appear in the GROUP BY clause or be used in an aggregate function

This is my query. ShopifyOrderLineItem.select("shopify_order_line_items.*, sum(amount) as total_price, sum(quantity) as total_quantity").where(:vendor_id => vendor_id).group("shopify_order_line_items.title") I'm getting the following…
Kevin
  • 304
  • 3
  • 14
-1
votes
2 answers

Using Postgresql with Amazon Opsworks - Getting IP address in database.yml

I'm trying to get a basic rails app working with Postgres using Amazon Opsworks. Opsworks lacks built-in support for Postgres at the moment, but I'm using some cookbooks that I've found which seem to be well written. I've forked them all to my…
tibbon
  • 1,018
  • 2
  • 16
  • 30
-2
votes
1 answer

Ruby on Rails - how can I open project with postgres?

last day I have get a ruby on rails project. Know my question: How can I open this project (with postgres). More information: My contribution is Windows. Ruby and Rails are both installed. First I navigate via cmd to my project folder I install the…
-2
votes
1 answer

Poor performing postgres sql

Here's my sql, followed by the explanation. I need to improve the performance. Any ideas? PostgreSQL 9.3.12 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4, 64-bit explain analyze SELECT DISTINCT "apts"."id",…
1 2 3
32
33