mac*postgres*ruby
テストスクリプト
require "rubygems" require "postgres" conn = PGconn.connect("localhost", 5432, "", "", "dbname", "dbuser"); res = conn.exec("select * from verbs;"); p rows = res.num_tuples p cols = res.num_fields for i in 0..rows-1 do for j in 0..cols-1 do print res.getvalue(i,j)," " end print "\n" end conn.close
とりあえず動いた。
結論
要hack。
使い方イミフ。