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
0 answers

Kaminari and PG::UndefinedFunction: ERROR: could not identify an equality operator for type point

I have two models: Country and Resort. Resort has field point with type "point". Model Country has_many Resorts. When i get countries resorts with kaminari( .page(params[:page]).per(20) ) i have an error: PG::UndefinedFunction: ERROR: could not…
KriM
  • 1
  • 1
0
votes
1 answer

Error running node, npm install pg error and gyp error

When I run node app.js, I get: Error: Cannot find module '/home/jchan1/projects/versiv-api/node_modules/pg/lib/native/../../build/default/binding' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load…
Jack
  • 5,264
  • 7
  • 34
  • 43
0
votes
3 answers

error while deploying rails app to heroku

I am new to rails and heroku i tried the following code to push my app to heroku rails new snippets cd snippets git init git add . git commit -m "initial commit" wget -O- https://toolbelt.heroku.com/install-ubuntu.sh | sh …
pokiri
  • 87
  • 1
  • 3
  • 11
0
votes
1 answer

Mock 'end' signal from emitter, but it doesn't get called

I am doing a unit testing with mocha + unit.js + proxyquire. Right now I am stuck at mocked emitter. First mocked emitter which is a fake on 'row' signal, it done. Second one I followed the same like first one. Since it is not a big difference, but…
joe
  • 8,383
  • 13
  • 61
  • 109
0
votes
1 answer

What to do after Heroku pg:pull?

After much research, I successfully ran heroku pg:pull (MYAPPNAME)::URL mylocaldb; however, my localhost website is not updated with the database from Heroku. Is there another step I should do now? I tried to run it again and it says ERROR: …
Joe Dayvie
  • 304
  • 3
  • 14
0
votes
2 answers

How would I do a pop on a PG::Result in Ruby?

Running a pop on a result set from a pgsql database I get: undefined method `pop' for # I want to get the first 5 of that result set, do something with it, then do it again with the next 5. I don't want to run my query…
Julien Lamarche
  • 931
  • 1
  • 12
  • 29
0
votes
1 answer

Issue with database call

I have been trying to come up with a database call that would give me everything from the choices column from the questionnaires table. I was able to iterate and list the choices themselves but they have their own index value The code @choices =…
Michael Stokes
  • 401
  • 1
  • 10
  • 24
0
votes
0 answers

event-stream map works outside pg Callback but not inside

I have trouble with event-stream in a pg callback. I was able to reduce it with this small piece of code: var es = require('event-stream'); var pg = require('pg'); var ar = ['dd','dd','aa']; var s1 = es.readArray(ar); var s2 =…
TheFive
  • 168
  • 1
  • 10
0
votes
0 answers

How to create a function return value with async and promise?

I'm learning about pg-promise. My question is very simple. I want to create a function return true if it found a result. but it kept returning false because of async. Could someone give me a comprehensive advice how to handle the beast…
Phi Nguyen
  • 3,046
  • 14
  • 26
0
votes
1 answer

`Heroku pg:backups capture` gives "Resource not found" error

When running this command - either locally or through Codeship.io - I get an error message saying "Resource not found" $ heroku pg:backups capture ! Resource not found The problem started 2 days ago and thus my first guess was that it's because…
yas4891
  • 4,774
  • 3
  • 34
  • 55
0
votes
1 answer

Can't install gem pg

I just started learning Ruby on Rails with my mac and I'm stuck. I'm using PostgreSQL as my database, and of course, the gem 'pg'. When I bundle install or I try to create a controller it gives me lots of syntax errors. However, if I delete that…
0
votes
1 answer

Rails4 order method does not work in PostgreSQL

i created a method like below def sort_by_footprints joins(:footprints).group(:article_id).order('SUM(articles.id) DESC') end but this doesn't work when i use postgresql and it says ActionView::Template::Error (PG::GroupingError: ERROR: column…
Fumiya
  • 127
  • 10
0
votes
2 answers

PG error using rails where

I have simple query like User.where('(zone_id IN (?) AND zone_type = "Org") OR (zone_id = ? AND zone_type ="Com")', [1,2,3], 10) This throws me PG::UndefinedColumn: ERROR: column "Org" does not exist What am i doing wrong?
Avdept
  • 2,261
  • 2
  • 26
  • 48
0
votes
1 answer

PG query for select and group in rails 4

I am learning join tables for associations and fire select and group query together. Suppose I have database like: Orders: #has_many :items id , title , description Items: #belongs_to :order #belongs_to :product id , order_id , name , product_id ,…
Hetal Khunti
  • 787
  • 1
  • 9
  • 23
0
votes
1 answer

Why does my rails app raise a "database configuration does not specify adapter (ActiveRecord::AdapterNotSpecified)" error?

I just updated my production rails app with Capistrano within a new gemset for ruby 2.2 and I got the following error…
Douglas
  • 5,229
  • 3
  • 43
  • 54