A PostgreSQL client library for Ruby https://github.com/ged/ruby-pg
Go to file
Michael Granger 9cf6a5164d Update Rafał Bigaj's email address in Contributors.rdoc at his request 2012-10-01 08:05:35 -07:00
ext Fix the documentation for Result#check (refs #123) 2012-09-07 08:03:27 -07:00
lib Bump the patch version, update history. 2012-08-12 18:56:04 -07:00
misc Update windows cross compilation tasks to the latest Openssl+Postgresql versions and the latest mingw-w64 compiler 2012-06-17 22:30:09 +02:00
sample Adding a minimal "connection-test function" example 2012-06-17 09:18:00 -07:00
spec Add missing require for using the TCPServer in connection_spec. This fixes #137 . 2012-08-04 15:53:28 +02:00
.gemtest Converted to Hoe 2011-10-07 07:42:14 -07:00
.hgignore Add a stub gem build for the deprecated 'postgres' gem 2012-02-09 14:18:24 -08:00
.hgsigs Added signature for changeset 52d22b060501 2012-09-02 08:43:05 -07:00
.hgtags Added tag v0.14.1 for changeset 2d83ce956f97 2012-09-02 08:43:06 -07:00
.hoerc New method: PG::Result#check. (fixes #123) 2012-06-17 10:20:28 -07:00
.irbrc Updated build system 2010-01-03 11:40:46 -08:00
.pryrc Rearranging classes under the PG namespace to be a better Ruby citizen 2012-01-24 17:21:30 -08:00
.rvm.gems Bump the hoe-deveiate version in the rvm gemset 2012-06-17 09:13:38 -07:00
.rvmrc Updated rvmrc 2012-02-22 11:31:38 -08:00
.tm_properties Rearranging classes under the PG namespace to be a better Ruby citizen 2012-01-24 17:21:30 -08:00
BSDL Add missing BSDL license file (fixes #108) 2012-02-09 12:55:59 -08:00
Contributors.rdoc Update Rafał Bigaj's email address in Contributors.rdoc at his request 2012-10-01 08:05:35 -07:00
History.rdoc Updating the History file 2012-09-02 08:42:50 -07:00
LICENSE Updated/simplified authors/license sections of the README, API doc cleanup, 2012-01-24 17:21:30 -08:00
Manifest.txt Adding a minimal "connection-test function" example 2012-06-17 09:18:00 -07:00
POSTGRES fix cross compilation of win32 binary gem, fix mixed case file naming 2012-01-27 15:35:31 +01:00
README-OS_X.rdoc More case-corrections 2012-01-27 14:56:04 -08:00
README-Windows.rdoc More case-corrections 2012-01-27 14:56:04 -08:00
README.ja.rdoc Updated/simplified authors/license sections of the README, API doc cleanup, 2012-01-24 17:21:30 -08:00
README.rdoc Updated the History file, Manifest, README, added missing require. 2012-01-24 19:33:10 -08:00
Rakefile Use RbConfig instead of obsolete and deprecated Config. 2012-06-17 22:27:53 +02:00
Rakefile.cross Update windows cross compilation tasks to the latest Openssl+Postgresql versions and the latest mingw-w64 compiler 2012-06-17 22:30:09 +02:00

README.rdoc

= pg

* https://bitbucket.org/ged/ruby-pg

== Description

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


== Requirements

* Ruby 1.8.7-p249 or 1.9.3-p0.
* PostgreSQL 8.3.x (with headers, -dev packages, etc).

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


== How To Install

Install via RubyGems:

    gem install pg

You may need to specify the path to the 'pg_config' program installed with
Postgres:

    gem install pg -- --with-pg-config=<path to pg_config>

See README-OS_X.rdoc for more information about installing under MacOS X, and
README-Windows.rdoc for Windows build/installation instructions.

There's also {a Google+ group}[http://goo.gl/TFy1U] and a
{mailing list}[http://groups.google.com/group/ruby-pg] if you get stuck, or just
want to chat about something.


== Contributing

To report bugs, suggest features, or check out the source with Mercurial,
{check out the project page}[http://bitbucket.org/ged/ruby-pg]. If you prefer
Git, there's also a {Github mirror}[https://github.com/ged/ruby-pg].

After checking out the source, run:

    $ rake newb

This task will install any missing dependencies, run the tests/specs, and
generate the API documentation.

The current maintainer is Michael Granger <ged@FaerieMUD.org>.


== Copying

Copyright (c) 1997-2012 by the authors.

* Jeff Davis <ruby-pg@j-davis.com>
* Guy Decoux (ts) <decoux@moulon.inra.fr>
* Michael Granger <ged@FaerieMUD.org>
* Dave Lee
* Eiji Matsumoto <usagi@ruby.club.or.jp>
* Yukihiro Matsumoto <matz@ruby-lang.org>
* Noboru Saitou <noborus@netlab.jp>

You may redistribute this software under the same terms as Ruby itself; see
http://www.ruby-lang.org/en/LICENSE.txt 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.


== Acknowledgments

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.