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

error: use of undeclared identifier 'NODE_PSYMBOL'

Trying to install pg. Here's the full log: $ npm install pg --save npm WARN package.json hs-app@0.0.0 No description npm WARN package.json hs-app@0.0.0 No repository field. npm WARN package.json hs-app@0.0.0 No README data npm http GET…
dschwertfeger
  • 286
  • 1
  • 4
  • 21
0
votes
1 answer

How to use ST_GeomFromText with PG::prepare? (Ruby)

I am having trouble with the syntax relate to PG::prepare, ST_GeomFromText, and POINT. This works: sql = %Q%insert into #{table_name} (latlong, place_name) values (ST_GeomFromText('POINT(0 0)', 4326), $1 )% conn.prepare('statement1', sql) This…
user664833
  • 18,397
  • 19
  • 91
  • 140
0
votes
2 answers

Rails shows rows from model, which aren't created

I have this part of code: <% current_user.meta_accounts.each do |meta_account| %> <%= content_tag(:li, link_to(meta_account.name, 'javascript:void(0)')) %> <% end %> So, I want Rails to show all my MetaAccounts in list, but I get this:
  • Peter Tretyakov
    • 3,380
    • 6
    • 38
    • 54
  • 0
    votes
    0 answers

    Rails 4 + Postgresql array type: Weird behavior when saving record, can't cast array

    So, I'm having the following setup in Rails 4 with PostgreSQL # migration create_table :custom_category_groups do |t| t.string :name t.string :content_types, array: true, default: [] end # controller class CustomCategoryController <…
    Vapire
    • 4,568
    • 3
    • 24
    • 41
    0
    votes
    0 answers

    Having trouble with PhoneGap iOS app

    I'm new to PhoneGap Build, and I'm trying to start creating an app in PG Build. I tried just moving everything over, but I'm having trouble, so I started by trying to make a simple app that just shows an alert box. This is still not working, so I…
    Caleb
    • 827
    • 2
    • 13
    • 30
    0
    votes
    0 answers

    pg_search with modified content

    Does anyone know how to modify columns content before pg_search stores it? Full explanation: I have model Article with columns title and body. In body I store article's body html. PgSearch is configured with multisearchable against: [:title,…
    tomazzlender
    • 1,123
    • 12
    • 22
    0
    votes
    1 answer

    RuntimeError: ERROR Mrelation "tablename" does not exist

    Rails - 2.3.8 Database - Postgres(9.2) Active record query is not able to generate tablename in double quotes ie # this ran fine Table.find_by_sql('Select * from "Table" Limit 1') Sql generated - Select * from "Table" Limit 1 But…
    0
    votes
    1 answer

    How to select records using table relationships and timestamps?

    Another newbie PostgreSQL question. I have something like this: CREATE TABLE user ( userID bigserial primary key, name varchar(50) NOT NULL, created timestamp NULL DEFAULT CURRENT_TIMESTAMP ) CREATE TABLE session ( sessionID bigserial…
    dsp_099
    • 5,801
    • 17
    • 72
    • 128
    0
    votes
    2 answers

    Upsert in Postgres Ruby

    I have seen the other questions that deal with this issue and I know that PostgreSQL doesn't have an inbuilt upsert and must be done using 2 methods. This is the code I'm using in Ruby using the pg gem. @db.exec_params("UPDATE crawled SET url = $1,…
    Althaf Hameez
    • 1,511
    • 1
    • 10
    • 18
    0
    votes
    0 answers

    Viewing SCHEMA logs for postgresql in Rails

    I'm having a hard time trying to get logging to include postgres schema changes in it. I've isolated the line of code that blocks them, but rather than being a configurable option, it seems to be hard coded that they don't appear. Right now I'm…
    Brendon Muir
    • 4,540
    • 2
    • 33
    • 55
    0
    votes
    0 answers

    Setting connection parameters postgresql in ruby

    When I run my rails server, and load up my localhost:3000 page, I get an error saying that I haven't supplied the database password. I'm using the better errors gem, so it shows me to go to my postgresql-adapter.rb file (located at…
    Amar H-V
    • 1,316
    • 3
    • 20
    • 33
    0
    votes
    1 answer

    An error occurred while installing pg (0.15.1) ; PostgreSQL on Mac Installation Error: no pg_config, gem native extension build failure

    I have OSX 10.6.8 and am trying to install PostgreSQL 9.2 on my device. I used the graphical installer available on their website, and set up the software, without using stack builder at the end to additionally configure other functions. When I load…
    Annika
    • 55
    • 2
    • 10
    0
    votes
    1 answer

    pg gem not installing

    hi i am trying to install the pg gem though whenever i bundle install i am getting the following issue Installing pg (0.15.1) Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. …
    Boss Nass
    • 3,384
    • 9
    • 48
    • 90
    0
    votes
    0 answers

    Storing rails code in database. Upgraded from Rails 2 to Rails 3

    I have the following piece of code illustrated as below. Was working in my Rails 2 application but having upgraded to Rails 3 it not longer works. When I render this code, I'm getting like, <%= radio_button <%= text_field "submission_data",…
    Dhara Joshi
    • 407
    • 5
    • 9
    0
    votes
    0 answers

    What explicit type casts should I add to make a no operator method work

    I'm trying to use the near method of the Ruby geocoder gem in a Rails application with a postgres database. @users = Contact.near(params[:search], params[:distance]) That line produces the 'operator does not exist error' you see below. The search…
    BrainLikeADullPencil
    • 11,313
    • 24
    • 78
    • 134