pg version 0.14.0 has been released!
Pg is the Ruby interface to the {PostgreSQL
RDBMS}[http://www.postgresql.org/].
It works with {PostgreSQL 8.3 and later}[http://bit.ly/6AfPhm].
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.14.0 [2012-06-17] Michael G. [email protected]
Bugfixes:
#47, #104
New Methods for PostgreSQL 9 and async API support:
PG
- ::library_version
PG::Connection
- ::ping
- #escape_literal
- #escape_identifier
- #set_default_encoding
PG::Result
- #check
New Samples:
This release also comes with a collection of contributed sample scripts
for
doing resource-utilization reports, graphing database statistics,
monitoring for replication lag, shipping WAL files for replication,
automated tablespace partitioning, etc. See the samples/ directory.