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
13
votes
10 answers

Error installing pg gem on osx

I am on osx 10.6.7 trying to run bundle install on a new rails 3.0.7 app and it keeps failing when trying to build the pg gem. It keeps telling me that I have need the developer tools. But as far as I can tell I have the developer tools…
Ben Matz
  • 143
  • 1
  • 1
  • 5
13
votes
7 answers

rake db:setup results in fe_sendauth no password supplied

When I run: rake db:setup i get: fe_sendauth: no password supplied Couldn't create database for {"adapter"=>"postfresql", "encoding"=>"unicode", "host"=>"localhost", "pool"=>5, "username"=>"my_user", "password"=>nil, …
szatan
  • 517
  • 4
  • 8
  • 26
12
votes
7 answers

Can't push app Heroku - Failed to install gems via Bundler

This is how looks my Gemfile: source 'http://rubygems.org' gem 'rails', '3.1.2' #gem 'sqlite3' gem 'mysql2' gem "rvm", "~> 1.9.2" gem 'authlogic' gem "taps", "~> 0.3.23" gem "paperclip", "~> 2.4.5" gem 'aws-s3' gem 'actionmailer' gem…
user984621
  • 46,344
  • 73
  • 224
  • 412
12
votes
2 answers

PG (node-postgres) VS. sequelize

I just want to ask which database module is better, PG or sequelize? I heard that sequelize has sometimes problem with transaction. Thanks
noone
  • 271
  • 4
  • 6
11
votes
2 answers

PG::ConnectionBad: could not translate host name error after running export DATABASE_URL=postgres://$(whoami)

I received this error after running export DATABASE_URL=postgres://$(whoami) on the command line. Now when I run the command $$ rake db:migrate This is the full error rake aborted! PG::ConnectionBad: could not translate host name "Jillian" to…
Jillian Hoenig
  • 137
  • 1
  • 6
  • 28
11
votes
2 answers

Should I ignore schema.rb because extension differs on development/production OS?

My database uses PostgreSQL. I develop on Mac and this line is needed: # db/schema.rb on Mac environment enable_extension "plpgsql" However, the extension is not required on Linux. In this case, should we just ignore schema.rb and generate that…
Clucking Turtle
  • 922
  • 1
  • 11
  • 24
11
votes
1 answer

How to get the id of the row inserted from PG::Result

I've ran a simple insert command: INSERT INTO names (name) VALUES ('john') As a response I get a PG::Result object. I've been digging through those docs but I can't squeeze out of that object the info I need: what is the ID of the row I've just…
dsp_099
  • 5,801
  • 17
  • 72
  • 128
10
votes
4 answers

pg gem install fails, cannot find libpq-fe.h header

Whenever I run bundle install on my VPS (CentOS Linux release 7.0.1406 (Core)) I get an error when installing the pg gem. No pg_config... trying anyway. If building fails, please try again with --with-pg-config=/path/to/pg_config checking for…
Wes
  • 537
  • 4
  • 25
10
votes
4 answers

How can i setup the path for heroku postgresql app?

I just installed the heroku PSQL app (v1.0) and i'm having trouble being able to connect my rails apps using the gem pg "0.1.4". I already added the path PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH" to my .profile and my .bashrc files,…
Diego Gomes
  • 565
  • 6
  • 15
9
votes
5 answers

What is the correct way to install ruby on ubuntu 22.04

There is an issue with installing ruby on ubuntu 22.04 with rvm as it will give you error below Error running '__rvm_make -j8', please read /usr/share/rvm/log/1655413907_ruby-2.5.0/make.log There has been an error while running make. Halting the…
arthur-net
  • 1,138
  • 1
  • 13
  • 34
9
votes
0 answers

rails can't reconnect to postgres database

I have a rails app (4.1.5) backed by a postgres database (9.2.13) using the pg gem (0.17.1), unicorn server (1.1.0) with 2 worker processes. The rails app runs jobs using sidekiq (2.17.7) At some point the postgres db went into recovery mode. The…
Knut Knutson
  • 163
  • 2
  • 8
9
votes
2 answers

Using LIMIT / ORDER BY with pg Postgres NodeJS as a Parameter

I have a model with calls the products with SORT/PAGE/PER PAGE It works fine with numerical values as parameters but not strings. This works fine... params.limit = 12 client.query('SELECT * FROM products LIMIT $1', [params.limit], function(err,…
Matt The Ninja
  • 2,641
  • 4
  • 28
  • 58
9
votes
2 answers

PG pg_ext load error in rails

I recently updated to rails 4.1.6 and ruby 2.1.3p242. I also updated all gems on my system. After creating a new app, I keep getting a pg_ext load file error on running the server. I'm on windows 8 x64 with PostgreSQL 9.3. The pg gem was working…
Ritikesh
  • 1,228
  • 1
  • 9
  • 19
9
votes
1 answer

Get records with empty hstore

I'm using a PostgreSQL database with hstore extension and i'm trying to make a simplest thing possible - get all the records, which vd_data (hstore) column is empty ({}). It sounds really easy but i'm not able to do it by myself nor find anything…
mbajur
  • 4,406
  • 5
  • 49
  • 79
9
votes
1 answer

Adding or Subtracting Time From Postgres Timestamps

I am using the following ruby code, with the PG gem, to return a timestamp that is in Postgres "timestamp without timezone" format. Instead of returning the current value, I would like it to return the value (-1 hour). def get_latest_timestamp(id) …
HMLDude
  • 1,547
  • 7
  • 27
  • 47
1 2
3
56 57