class Object

Constants

PGError

This is the exception class raised when an error is returned from a libpq API call.

The attributes connection and result are set to the connection object and result set object, respectively.

If the connection object or result set object is not available from the context in which the error was encountered, it is nil.

PGconn

The PostgreSQL connection class. The interface for this class is based on libpq, the C application programmer's interface to PostgreSQL. Some familiarity with libpq is recommended, but not necessary.

For example, to send query to the database on the localhost:

require 'pg'
conn = PG::Connection.open(:dbname => 'test')
res = conn.exec_params('SELECT $1 AS a, $2 AS b, $3 AS c', [1, 2, nil])
# Equivalent to:
#  res  = conn.exec('SELECT 1 AS a, 2 AS b, NULL AS c')

See the PG::Result class for information on working with the results of a query.

PGresult

#<RDoc::Comment:0x000000021cda48>


#<RDoc::Comment:0x00000001c680a8>