# \[ANN\] pg 0.15.0 Released

**URL:** <https://rubytalk.org/t/ann-pg-0-15-0-released/67580>\
**Category:** ruby-talk\
**Created:** [26 March 2013 14:38 UTC](https://rubytalk.org/t/ann-pg-0-15-0-released/67580 "2013-03-26T14:38:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Granger](https://avatars.discourse-cdn.com/v4/letter/m/a88e4f/32.png) [@Michael\_Granger](https://rubytalk.org/u/Michael_Granger)\
**Post date:** [26 March 2013 14:38 UTC](https://rubytalk.org/t/ann-pg-0-15-0-released/67580/1 "2013-03-26T14:38:34Z")

</div>

pg version 0.15.0 has been released!

\* \<[https://bitbucket.org/ged/ruby-pg](https://bitbucket.org/ged/ruby-pg)\> (home)  
\* \<[https://github.com/ged/ruby-pg](https://github.com/ged/ruby-pg)\> (mirror)  
\* \<[http://deveiate.org/code/pg](http://deveiate.org/code/pg)\> (docs)

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

It works with {PostgreSQL 8.3 and later}[[http://bit.ly/6AfPhm](http://bit.ly/6AfPhm)].

A small example usage:

&nbsp;&nbsp;#!/usr/bin/env ruby

&nbsp;&nbsp;require 'pg'

&nbsp;&nbsp;# Output a table of current connections to the DB  
&nbsp;&nbsp;conn = PG.connect( dbname: 'sales' )  
&nbsp;&nbsp;conn.exec( "SELECT \* FROM pg\_stat\_activity" ) do |result|  
&nbsp;&nbsp;&nbsp;&nbsp;puts " PID | User | Query"  
&nbsp;&nbsp;result.each do |row|  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;puts " %7d | %-16s | %s " %  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;row.values\_at('procpid', 'usename', 'current\_query')  
&nbsp;&nbsp;&nbsp;&nbsp;end  
&nbsp;&nbsp;end

Changes:

> **···**
>
> == v0.15.0 [2013-03-03] Michael Granger \<[ged@FaerieMUD.org](mailto:ged@FaerieMUD.org)\>
> 
> Bugfixes:
> 
> - Fix segfault in PG::Result#field\_values when called with non String value.  
> - Fix encoding of messages delivered by notice callbacks.  
> - Fix text encoding for Connection#wait\_for\_notify and Connection#notifies.  
> - Fix 'Bad file descriptor' problems under Windows: wrong behaviour of  
> &nbsp;&nbsp;#wait\_for\_notify() and timeout handling of #block on Ruby 1.9.
> 
> Documentation fixes:
> 
> - conn#socket() can not be used with IO.for\_fd() on Windows.
> 
> Enhancements:
> 
> - Tested under Ruby 2.0.0p0.  
> - Add single row mode of PostgreSQL 9.2.  
> - Set fallback\_application\_name to programm name $0. Thanks to Will Leinweber  
> &nbsp;&nbsp;for the patch.  
> - Release Ruby's GVL while calls to blocking libpq functions to allow better  
> &nbsp;&nbsp;concurrency in threaded applications.  
> - Refactor different variants of waiting for the connection socket.  
> - Make use of rb\_thread\_fd\_select() on Ruby 1.9 and avoid deprecated  
> &nbsp;&nbsp;rb\_thread\_select().  
> - Add an example of how to insert array data using a prepared statement (#145).  
> - Add continous integration tests on [travis-ci.org](http://travis-ci.org).  
> - Add PG::Result#each\_row for iterative over result sets by row. Thanks to  
> &nbsp;&nbsp;Aaron Patterson for the patch.  
> - Add a PG::Connection#socket\_io method for fetching a (non-autoclosing) IO  
> &nbsp;&nbsp;object for the connection's socket.
> 
> Specs:
> 
> - Fix various specs to run on older PostgreSQL and Ruby versions.  
> - Avoid fork() in specs to allow usage on Windows and JRuby.
