Pg 0.13.2 Released

pg version 0.13.2 has been released!

Pg is the Ruby interface to the PostgreSQL RDBMS
[http://www.postgresql.org/].

It works with PostgreSQL 8.3 and later.

A small example usage:

#!/usr/bin/env ruby

require ‘pg’

Output a table of current connections to the DB

conn = PG.connect( dbname: ‘sales’ )
conn.exec( “SELECT * FROM pg_stat_activity” ) do |result|
puts " PID | User | Query"
result.each do |row|
puts " %7d | %-16s | %s " %
row.values_at(‘procpid’, ‘usename’, ‘current_query’)
end
end

Changes:

  • Make builds against PostgreSQL earlier than 8.3 fail with a
    descriptive
    message instead of a compile failure.

Is there a documentation for PG::Result avaible?