Skip to content


Subversion checkout URL

You can clone with
Download ZIP
A JRuby version of the "pg" gem.
Java Ruby C C++ Shell
Branch: master
Failed to load latest commit information.
certs Add support for JRuby
ext Make options params optional
lib add the jar file to the repo so users can use bundler :git => ...
misc Update windows cross compilation tasks to the latest Openssl+Postgres…
sample Whitespace cleanup
spec try to make travis ci green
.gemtest Converted to Hoe
.gitignore add the jar file to the repo so users can use bundler :git => ...
.hgignore Add generated error codes file to the ignorelist
.hgsigs Added signature for changeset 22d57e3a2b37
.hgtags Added tag v0.17.0 for changeset 30da9c169efc
.hoerc Add the Gemfile to the list of files that don't have to be on the Man…
.irbrc Updated build system
.pryrc Rearranging classes under the PG namespace to be a better Ruby citizen
.tm_properties Fix indent in project settings
.travis.yml simplify our test matrix for now
BSDL Add missing BSDL license file (fixes #108)
Contributors.rdoc Update the docs
Gemfile Add Gemfile for compat with rake-compiler-dev-box.
History.rdoc Bump the patch version, set the date in History.
LICENSE Updated/simplified authors/license sections of the README, API doc cl…
Manifest.txt Use inheritance to describe multiple types of PGErrors.
POSTGRES fix cross compilation of win32 binary gem, fix mixed case file naming
README-OS_X.rdoc More case-corrections
README-Windows.rdoc More case-corrections
README.ja.rdoc Update READMEs
README.rdoc add instructions on how to use the gem on rails
Rakefile temporary fix for building on JRuby
Rakefile.cross Use RbConfig::CONFIG['CC'] instead of ['host'] for determining cross add a TODO add a script that supports tesitng with rails



This is a JRuby gem replacement for ruby-pg. The gem should be a drop-in replacement for ruby-pg version 0.17.1. If you see any inconsistency please open an issue {here}(


For documentation please refair to the MRI pg gem docs which you can find {here}( The original ruby-pg project can be found {here on github}(

Build Status



The gem has been tested with the following:

  • JRuby 1.7.18

  • PostgreSQL 9.3.6

It may work with earlier versions of Ruby/PostgreSQL as well, but those are not regularly tested.

How To Install

NOTE: if you are installing jruby-pg to use it with rails you'll

have to install it using bundler

Install via RubyGems:

gem install pg_jruby

Install via Bundler, in your gemfile add the following:

# Please note that the 1.0 is necessary to let bundler do its dependency management, as there is no .gemspec in the source.
gem 'pg', '0.17.1', :platform => :jruby, :git => 'git://', :branch => :master

# comment the activerecord-jdbcsqlite3-adapter line
# gem 'activerecord-jdbcsqlite3-adapter'


Copyright © 1997-2013 by the authors.

MRI contributors

  • Jeff Davis <>

  • Guy Decoux (ts) <>

  • Michael Granger <>

  • Lars Kanis <>

  • Dave Lee

  • Eiji Matsumoto <>

  • Yukihiro Matsumoto <>

  • Noboru Saitou <>

JRuby contributors

  • John Shahid <>

You may redistribute this software under the same terms as Ruby itself; see or the LICENSE file in the source for details.

Portions of the code are from the PostgreSQL project, and are distributed under the terms of the PostgreSQL license, included in the file POSTGRES.

Portions copyright LAIKA, Inc.


See Contributors.rdoc for the many additional fine people that have contributed to this library over the years.

We are thankful to the people at the ruby-list and ruby-dev mailing lists. And to the people who developed PostgreSQL.

Something went wrong with that request. Please try again.