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

Can't install gem -- install-tools

I am trying to install the pg gem in OSX Yosemite beta. It's giving me an error You have to install development tools first. So I try xcode-select --install and it tells me they are already installed: xcode-select: error: command line tools are…
user101289
  • 9,888
  • 15
  • 81
  • 148
0
votes
1 answer

Using the Ruby pg gem, what is the best way to add potentially null values to a database?

I am trying to add an object to the database like this: DB.exec("INSERT INTO patients (name, birthdate) VALUES ('#{name}', '#{birthdate}');") The problem is that if either of these values is nil, the data will be saved incorrectly or there will be…
0
votes
1 answer

How can I export data from one schema to insert on another schema with the same structure

I want to move all my data on my 'test1' schema on all table where id > 5000 So, I did export 'test1' schema and create new temp schema name 'test1_new' then I do this on all table INSERT INTO test1_new.{table_name} SELECT * FROM…
Tanapat Sainak
  • 734
  • 1
  • 10
  • 22
0
votes
1 answer

Error Installing PG Gem on Windows

I'm using XAMPP as my installation folder for PostgreSQL 9.3. C:\xampp\pgsql\9.3 And now I'm trying to install PostgreSQL gem using that directory as a reference: gem install pg -- --with-pg-include="C:\xampp\pgsql\9.3\include"…
Jay Kazama
  • 3,167
  • 2
  • 19
  • 25
0
votes
0 answers

How do I tell PG use the database.yml file?

Here is a simple database connection, and query thats working for me; postgre_conn = PG::Connection.open(:host => 'dbsvr', :user => 'csdashboard', :password => 'csdashboard', :dbname => 'csdashboard') @filtered_snort_detail_query =…
insecure-IT
  • 2,068
  • 4
  • 18
  • 26
0
votes
1 answer

Rails: PG Array type?

I ran across this article Tagging in Rails 4 using PostgreSQL arrays demonstrating the power of array data types in Postgres. It seems like it could be useful in many ways, but I never see anyone use it in Rails. Why is this? Is it solely because…
user3181113
  • 758
  • 2
  • 11
  • 23
0
votes
0 answers

PGError "column doesnt exist" with default_scope in Rails 3

I have a rails 2.3.8 application which I migrated to rails 3.0.10 However after migration, I could see issues using default_scope in the models. I am baffled why it is coming , though everything worked fine previously .I am using pg 0.11 gem . In…
Gaurav
  • 111
  • 8
0
votes
1 answer

Rails app behaves differently on heroku vs development

In Application Controller I have 2 methods : def current_user @current_user ||= User.find_by_auth_token( cookies[:auth_token]) if cookies[:auth_token] rescue ActiveRecord::RecordNotFound end helper_method :current_user def pro_user …
user2511030
  • 515
  • 1
  • 4
  • 14
0
votes
0 answers

ActiveRecord::StatementInvalid: PG::Error: ERROR: column contents.app_id does not exist

Having issues after upgrading rails from 3.0.20 => 3.1.12. When I run the unit test, some tests pass, but I get 8 errors and 18 failures. The error is column doesn't…
agstwn21
  • 123
  • 1
  • 14
0
votes
0 answers

ruby object id increment in steps of 2

I have a ruby application using devise to handle user authentication an pg as my data store. I just noticed that the first user object_id is 2 and subsequent object id's increment in steps of 2. I have dropped and recreated my local db several times…
Joshua
  • 805
  • 1
  • 8
  • 18
0
votes
1 answer

PG::Error: ERROR: relation does not exist (rails 3.1.3) on development vs production

I've blown away my database and am now having problems migrating back to a working database. The error looks the same as other questions already posted, but I can't figure out how to solve it. What can I change to get my environment back? How did…
MonkeyWidget
  • 956
  • 1
  • 9
  • 19
0
votes
1 answer

Postgres: how to use a image as bytea from a database as picture in a tag?

I have a table in postgres and it has a column in bytea format that contains pictures. I selected for it and stored the pictures in a array How can I display them?This do not work: echo ""; later I found out that…
user1986815
0
votes
1 answer

Query working in psql, but not working with pg.js

I have a query that works in psql, but when I insert it into my REST service it doesnt work. Here is my code: exports.getProjects = function(req, res) { 'use strict'; var query = client.query('select projects.project_id,…
jhamm
  • 24,124
  • 39
  • 105
  • 179
0
votes
1 answer

PG search by gender

I'm using the pgsearch gem and I'm having trouble allowing users to search by Gender what am I doing wrong? Firstly, when I click the gender drop down in search all I see is "1, 1, 1" horizontally.. When I should be seeing Male, Female.. I'm…
Sonny Black
  • 1,585
  • 4
  • 23
  • 41
0
votes
1 answer

How do I deploy local images from Refinery CMS to Heroku?

I developed my app with Refinery and I just deployed to Heroku. Everything works, except the images that were added to the pages through the CMS. To be more clear, the ones uploaded locally using the route: edit page > add image > upload > choose…
givanse
  • 14,503
  • 8
  • 51
  • 75