The extension for PostgreSQL access  version 0.7.1

                                         Yukihiro Matsumoto

Eiji Matsumoto

maintainer:    Noboru Saitou
  • What’s this ?

This is the extension library to access a PostgreSQL database from Ruby. This library works with PostgreSQL 6.5/7.0/7.1/7.2; it probably works with 6.3 or earlier with slight modification, but not tested at all.

  • Requirements

    Ruby 1.3.4 or later. PostgreSQL 6.4/6.5/7.0/7.1/7.2 installed.

  • How to install ?

Follow the instructions below to compile and install:

ruby extconf.rb
make
su              (if necessary)
make install

You may need to specify the directory name for the include files and the -lpq library by using

   --with-pgsql-include-dir=<include file directory>
   --with-pgsql-lib-dir=<library directory>
or 
   --with-pgsql-dir=<dir>
     Same as --with-pgsql-include-dir=<dir>/include,
     --with-pgsql-lib-dir=<dir>/lib

For example:

ruby extconf.rb --with-pgsql-include-dir=/usr/local/pgsql/include \
                --with-pgsql-lib-dir=/usr/local/pgsql/lib

or

ruby extconf.rb --with-pgsql-dir=/usr/local/pgsql/
  • How to use ?

You need to specify:

require "postgres"

at the top of your script.

  • What functions can I use ?

The list of supported functions are below. See postgres.html for detail.

class PGconn:

class methods:
   new
   connect
   setdb
   setdblogin

   escape
   quote
   escape_bytea

methods:
   db
   host
   options
   port
   tty
   status
   error
   finish
   close
   reset
   user
   trace
   untrace

   exec
   query
   async_exec
   async_query
   get_notify
   insert_table
   putline
   getline
   endcopy
   notifies

   lo_import
   lo_export
   lo_create
   lo_open  
   lo_unlink

   client_encoding
   set_client_encoding

class PGresult:

methods:
   each
   []
   status
   result
   fields
   num_tuples
   num_fields
   fieldname
   fieldnum
   type
   size
   getvalue
   getlength
   cmdstatus
   print
   clear

class PGlarge:

methods:
   open
   close
   read
   write
   lseek
   tell
   unlink
   oid
   size
   export
  • Acknowledgments

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

  • Copying

This library is copyrighted by its authors; Yukihiro Matsumoto, and Eiji Matsumoto.

You can redistribute This library and/or modify it under the same term of Ruby. License of Ruby is included with Ruby distribution in the file “README”.

Please ask Noboru Saitou. Because I am maintainer currently.

  • Authors

Yukihiro Matsumoto <[email protected]>
 Author of Ruby.

Eiji Matsumoto <[email protected]>
 One of users who loves Ruby.

No, we are not literal brothers :-)

  • Special Thanks

Guy Decoux   ts <[email protected]>
  • maintainer

Noboru Saitou <[email protected]>