ICI Modules: PQ
Modules by name : by typeOverview
The PQ module provides a number of interfaces to the PostgreSQL database system. At the lowest level the module provides access to functions defined the PostgreSQL C library.
Class Interface
The class interface uses ICI's object-oriented abilities and defines a number of classes to represent database connections and query results. These are implements in terms of the low-level interface described below.
- PostgreSQL.Connection - database connection class
- PostgreSQL.Result - query result class
- PostgreSQL.escape_string - utility to format strings
Low-level Interface
To represent connections to a PostgreSQL server a new type, "connection", is defined. A number of different functions return connections depending on how you want to connect.
Interface
PQ.conndefaults - return the default connection settings
PQ.connectdb - connect to a database
PQ.setdbLogin - connect to a database
PQ.connectStart - initiate a connection to a database
PQ.connectPoll - check pending connection status
PQ.status - get connection status
PQ.finish - terminate a connection
PQ.resetStart - initiate a connection reset
PQ.resetPoll - check for reset finish
PQ.db - set database for connection
PQ.user - set user for connection
PQ.pass - set password for connection
PQ.host - set host for connection
PQ.port - set TCP port for connection
PQ.tty - tty for connection
PQ.options - connection options
PQ.errorMessage - return error message
PQ.socket - return connection socket
PQ.clientEncoding - set client text encoding
PQ.backendPID - determine backend process
PQ.exec - exec SQL statements
PQ.resultStatus - get result status int
PQ.resStatus - get result status string
PQ.resultErrorMessage - get error message for failed query
PQ.cmdStatus - determine command status
PQ.oidStatus - determine row status
PQ.oidValue - get OID value
PQ.cmdTuples - return result tuples
PQ.ntuples - return number of tuples in result
PQ.nfields - return number of fields in result
PQ.binaryTuples - get binary tuples
PQ.fname - get field name from number
PQ.fnumber - get field number from name
PQ.ftype - get field type
PQ.fsize - get field size
PQ.fmod - field
PQ.getvalue - return field value
PQ.getlength - return field length
PQ.getisnull - determine if field NULL
PQ.clear - clear a result
PQ.print - print a field
PQ.trace - enable connection tracing
PQ.untrace - disable connection tracing