Questions tagged [pg]

'pg' is the name of an extension for Ruby that provides access to libpq, the C application programmer’s interface to the PostgreSQL RDBMS.

pg is the name of an extension for Ruby that provides access to libpq, the C application programmer’s interface to the PostgreSQL RDBMS. It provides a relatively complete mapping, including both synchronous and asynchronous query interfaces, notifications, support for the COPY command, and m17n support under Ruby 1.9.

It includes full RDoc API documentation, a copy of which can be found on the maintainer's site.

It is currently maintained and developed by Michael Granger.

854 questions
0
votes
1 answer

em-synchrony using http.get and iterators causing can't yield in root Fiber error

A very simple case where I get the root Fiber error. require 'em-synchrony' require 'em-synchrony/em-http' urls = %w{http://www.google.com http://www.google.com http://www.google.com http://www.google.com http://www.google.com…
keaplogik
  • 2,369
  • 2
  • 25
  • 26
0
votes
0 answers

update query not updating in postgresql

Not updating postgresql database when update_all using @change_stat = Notification.where("fb_id = ? AND active = ?",@current_user.fb_id,true) @change_stat.update_all(:active => false)
saran
  • 413
  • 1
  • 3
  • 14
0
votes
2 answers

Does db_link in postgres auto close connection when used with this format? How to auto close postgres dblink?

I have a query that connects to remote database and brings back results bit it in a function as shown below. CREATE OR REPLACE FUNCTION get_users() $BODY$ BEGIN RETURN QUERY SELECT c.user_id, c.user_name, c.user_subscrib FROM…
Horse Voice
  • 8,138
  • 15
  • 69
  • 120
0
votes
2 answers

Problems with belongs_to condition in model

I'm making personal money management app. There I have 2 models: Account and Transaction. Transaction has belongs_to :account and Account has has_many :transactions. When I had account_id column in db (postgres) everything worked fine. But I have to…
Peter Tretyakov
  • 3,380
  • 6
  • 38
  • 54
0
votes
1 answer

Renamed model class still appearing in active admin menu

I had to rename model class in my ruby on rails app due to name clashing with other class sitting in lib directory. Everything is fine when I run app both in production and development env on my local machine, however on old class name is still…
0
votes
4 answers

Rails 3, error installing pg gem

Tried to install pg gem I got the next error: alex@ubuntu:~/RubymineProjects/Tiger Skills$ gem install pg ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions into the /var/lib/gems/1.9.1…
Alex Klimashevsky
  • 2,457
  • 3
  • 26
  • 58
0
votes
1 answer

PG::Error EOF detected on Heroku Cedar, rails 3.2.11

Having experienced a few periods of downtime, we've recently upgraded to a production environment in Heroku (Crane database plus 2 x web dynos) however we've seen no improvement. In fact reliability seems to have decreased since upgrading. The root…
kierantop
  • 166
  • 1
  • 5
0
votes
1 answer

How to fix PGError in rails for ActiveRecord?

I am trying to get the unique values in the column 'genre' in Rails. The commented out section works on localhost but in production I get a PG Error: ActiveRecord::StatementInvalid (PGError: ERROR: for SELECT DISTINCT, ORDER BY expressions must…
sharataka
  • 5,014
  • 20
  • 65
  • 125
0
votes
1 answer

Not nil code that works for both sqlite3 and pg

I have a rails app running sqlite3 in development and pg in production, currently running on Heroku. I am getting an error on my heroku app. I have a column called 'archived' which starts out as nil until the user pushes a button, then the current…
lando2319
  • 1,509
  • 1
  • 19
  • 27
0
votes
1 answer

Ruby 1.9.3-p392 and PostgreSQL

I created a new rails app with rails new app_name -d postgresql and I am failing to use any rails command (rails s, rails g controller ControllerName, etc etc). I am getting these…
sebkkom
  • 1,426
  • 17
  • 31
0
votes
1 answer

How create postgres trigger in rails?

I have a table product(id,name) and table product_raiting(product_id,rate_type,rate). When I create new product, I need to create three raitings for this product. How can I add postgres trigger with do something like: product.create …
bmalets
  • 3,207
  • 7
  • 35
  • 64
0
votes
2 answers

Error install pg gem

I am getting the following error when trying to install 'pg' Any thoughts? I am pretty new to rails so I am not sure how to fix this issue. Davids-MacBook-Air:~ DavidStevenson$ install pg usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group]…
0
votes
1 answer

Is 4.5 sec reasonable for a ILIKE request with 1M items

Rails: 3.2.11 Ruby: 1.8.7 Database: Postgres I have a custom made search engine that uses ILIKE for a search among 1 million entries like this: formatted_query_string = '%this%search%string' like_variable = "ILIKE" product_feed_query_line = [ …
Christoffer
  • 2,271
  • 3
  • 26
  • 57
0
votes
1 answer

Does model_name.new() in ActiveRecord create only new records or update existing as well

I have a model that I use with active record in a ruby script below. Things like level_type, name, parent.id, and pipcode get assigned to the attributes of the model for entry into the levels table. My question is, does this only work for new…
Doublespeed
  • 1,153
  • 4
  • 16
  • 29
0
votes
1 answer

PGconn.connect details of the hash needed in ruby pg gem

I would like to better document my code rather than having a statement like the below: pg_c = PGconn.connect("Main-my_db_lk", 5433, '', '', "report_center", "repozenter", "rp_23_xhg") How do I know what is what in this statement? Is it possible to…
Doublespeed
  • 1,153
  • 4
  • 16
  • 29