Z
Zeno Davatz
Hi
The pg gem 0.10.1 does not seem to work with Ruby 1.9.2 with the method
@pg_conn.exec_prepared(stmt_name, parameters)
This does work:
C:\Users\Luis\Projects\_sandbox>irb
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'pg'
=> true
irb(main):003:0> conn = PGconn.opendbname => 'test', :user =>
'postgres', assword => '')
=> #<PGconn:0x2c9a198>
irb(main):004:0> res = conn.exec('SELECT 1 + 2')
=> #<PGresult:0x2bc0698>
irb(main):005:0> res.getvalue(0,0)
=> "3"
But this method does _not_ work:
@pg_conn.exec_prepared(stmt_name, parameters)
the resulting error is:
from /usr/lib/ruby/gems/1.9.1/gems/dbd-pg-0.3.9/lib/dbd/pg/
statement.rb:37:in `execute'
from /usr/lib/ruby/gems/1.9.1/gems/dbi-0.4.2/lib/dbi/
base_classes/database.rb:96:in `execute'
from /usr/lib/ruby/gems/1.9.1/gems/dbi-0.4.2/lib/dbi/
base_classes/database.rb:114:in `do'
from /usr/lib/ruby/gems/1.9.1/gems/dbi-0.4.2/lib/dbi/handles/
database.rb:106:in `do'
from /usr/lib/ruby/site_ruby/1.9.1/odba/storage.rb:176:in
`create_index'
from /usr/lib/ruby/site_ruby/1.9.1/odba/index.rb:226:in
`initialize'
from /usr/lib/ruby/site_ruby/1.9.1/odba/cache.rb:148:in `new'
from /usr/lib/ruby/site_ruby/1.9.1/odba/cache.rb:148:in `block
in create_index'
from /usr/lib/ruby/site_ruby/1.9.1/odba/storage.rb:558:in
`call'
from /usr/lib/ruby/site_ruby/1.9.1/odba/storage.rb:558:in
`block in transaction'
from /usr/lib/ruby/gems/1.9.1/gems/dbi-0.4.2/lib/dbi/handles/
database.rb:209:in `transaction'
from /usr/lib/ruby/site_ruby/1.9.1/odba/connection_pool.rb:
36:in `block in method_missing'
from /usr/lib/ruby/site_ruby/1.9.1/odba/connection_pool.rb:
26:in `next_connection'
from /usr/lib/ruby/site_ruby/1.9.1/odba/connection_pool.rb:
35:in `method_missing'
from /usr/lib/ruby/site_ruby/1.9.1/odba/storage.rb:554:in
`transaction'
from /usr/lib/ruby/site_ruby/1.9.1/odba/cache.rb:520:in
`transaction'
from /usr/lib/ruby/site_ruby/1.9.1/odba/cache.rb:140:in
`create_index'
from /usr/lib/ruby/site_ruby/1.9.1/odba/cache.rb:131:in `block
in create_deferred_indices'
from /usr/lib/ruby/site_ruby/1.9.1/odba/cache.rb:125:in `each'
from /usr/lib/ruby/site_ruby/1.9.1/odba/cache.rb:125:in
`create_deferred_indices'
from /usr/lib/ruby/site_ruby/1.9.1/odba/cache.rb:437:in
`setup'
from /usr/lib/ruby/site_ruby/1.9.1/oddb/persistence/odba.rb:
35:in `<module:ODDB>'
from /usr/lib/ruby/site_ruby/1.9.1/oddb/persistence/odba.rb:
28:in `<top (required)>'
from /var/www/ramaze.ch.oddb.org/model/init.rb:3:in `require'
from /var/www/ramaze.ch.oddb.org/model/init.rb:3:in `<top
(required)>'
from /var/www/ramaze.ch.oddb.org/app.rb:32:in `require'
from /var/www/ramaze.ch.oddb.org/app.rb:32:in `<top
(required)>'
from start.rb:7:in `require'
from start.rb:7:in `<main>'
Any Feedback is more then welcome.
This did work with Ruby 1.8.6 and Ruby 1.9.1
Best
Zeno
The pg gem 0.10.1 does not seem to work with Ruby 1.9.2 with the method
@pg_conn.exec_prepared(stmt_name, parameters)
This does work:
C:\Users\Luis\Projects\_sandbox>irb
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'pg'
=> true
irb(main):003:0> conn = PGconn.opendbname => 'test', :user =>
'postgres', assword => '')
=> #<PGconn:0x2c9a198>
irb(main):004:0> res = conn.exec('SELECT 1 + 2')
=> #<PGresult:0x2bc0698>
irb(main):005:0> res.getvalue(0,0)
=> "3"
But this method does _not_ work:
@pg_conn.exec_prepared(stmt_name, parameters)
the resulting error is:
from /usr/lib/ruby/gems/1.9.1/gems/dbd-pg-0.3.9/lib/dbd/pg/
statement.rb:37:in `execute'
from /usr/lib/ruby/gems/1.9.1/gems/dbi-0.4.2/lib/dbi/
base_classes/database.rb:96:in `execute'
from /usr/lib/ruby/gems/1.9.1/gems/dbi-0.4.2/lib/dbi/
base_classes/database.rb:114:in `do'
from /usr/lib/ruby/gems/1.9.1/gems/dbi-0.4.2/lib/dbi/handles/
database.rb:106:in `do'
from /usr/lib/ruby/site_ruby/1.9.1/odba/storage.rb:176:in
`create_index'
from /usr/lib/ruby/site_ruby/1.9.1/odba/index.rb:226:in
`initialize'
from /usr/lib/ruby/site_ruby/1.9.1/odba/cache.rb:148:in `new'
from /usr/lib/ruby/site_ruby/1.9.1/odba/cache.rb:148:in `block
in create_index'
from /usr/lib/ruby/site_ruby/1.9.1/odba/storage.rb:558:in
`call'
from /usr/lib/ruby/site_ruby/1.9.1/odba/storage.rb:558:in
`block in transaction'
from /usr/lib/ruby/gems/1.9.1/gems/dbi-0.4.2/lib/dbi/handles/
database.rb:209:in `transaction'
from /usr/lib/ruby/site_ruby/1.9.1/odba/connection_pool.rb:
36:in `block in method_missing'
from /usr/lib/ruby/site_ruby/1.9.1/odba/connection_pool.rb:
26:in `next_connection'
from /usr/lib/ruby/site_ruby/1.9.1/odba/connection_pool.rb:
35:in `method_missing'
from /usr/lib/ruby/site_ruby/1.9.1/odba/storage.rb:554:in
`transaction'
from /usr/lib/ruby/site_ruby/1.9.1/odba/cache.rb:520:in
`transaction'
from /usr/lib/ruby/site_ruby/1.9.1/odba/cache.rb:140:in
`create_index'
from /usr/lib/ruby/site_ruby/1.9.1/odba/cache.rb:131:in `block
in create_deferred_indices'
from /usr/lib/ruby/site_ruby/1.9.1/odba/cache.rb:125:in `each'
from /usr/lib/ruby/site_ruby/1.9.1/odba/cache.rb:125:in
`create_deferred_indices'
from /usr/lib/ruby/site_ruby/1.9.1/odba/cache.rb:437:in
`setup'
from /usr/lib/ruby/site_ruby/1.9.1/oddb/persistence/odba.rb:
35:in `<module:ODDB>'
from /usr/lib/ruby/site_ruby/1.9.1/oddb/persistence/odba.rb:
28:in `<top (required)>'
from /var/www/ramaze.ch.oddb.org/model/init.rb:3:in `require'
from /var/www/ramaze.ch.oddb.org/model/init.rb:3:in `<top
(required)>'
from /var/www/ramaze.ch.oddb.org/app.rb:32:in `require'
from /var/www/ramaze.ch.oddb.org/app.rb:32:in `<top
(required)>'
from start.rb:7:in `require'
from start.rb:7:in `<main>'
Any Feedback is more then welcome.
This did work with Ruby 1.8.6 and Ruby 1.9.1
Best
Zeno