pg version 0.15.1 has been released!
- https://bitbucket.org/ged/ruby-pg (home)
- https://github.com/ged/ruby-pg (mirror)
- http://deveiate.org/code/pg (docs)
Pg is the Ruby interface to the {PostgreSQL
RDBMS}[http://www.postgresql.org/].
It works with {PostgreSQL 8.4 and
later}[PostgreSQL: Versioning Policy].
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:
== v0.15.1 [2013-04-08] Michael G. [email protected]
Bugfixes:
- Shorten application_name to avoid warnings about truncated identifier.