pgobjectDBpgqueryobjectpglargeAuthor: Written by D'Arcy J.M. Cain (
<darcy@druid.net>). Based heavily on code written by Pascal Andre<andre@chimay.via.ecp.fr>. Copyright © 1995, Pascal Andre. Further modifications Copyright © 1997-2000 by D'Arcy J.M. Cain.
You may either choose to use the old mature interface provided by the pg module or otherwise the newer pgdb interface compliant with the DB-API 2.0 specification developed by the Python DB-SIG.
Here we describe only the older pg API. As long as PyGreSQL does not contain a description of the DB-API you should read about the API at http://www.python.org/topics/database/DatabaseAPI-2.0.html.
A tutorial-like introduction to the DB-API can be found at http://www2.linuxjournal.com/lj-issues/issue49/2605.html
The pg module defines three objects:
pgobject, which handles the connection and all the requests to the database,
pglargeobject, which handles all the accesses to PostgreSQL large objects, and
pgqueryobject that handles query results.
If you want to see a simple example of the use of some of these functions, see http://www.druid.net/rides where you can find a link at the bottom to the actual Python code for the page.
Some constants are defined in the pg module dictionary. They are intended to be used as a parameters for methods calls. You should refer to the libpq description (Chapter 1) for more information about them. These constants are:
INV_READINV_WRITE large objects access modes, used by (pgobject.)locreate and (pglarge.)open.
SEEK_SETSEEK_CURSEEK_END positional flags, used by (pglarge.)seek.
version__version__constants that give the current version
No comments could be found for this page.
Please use this form to add your own comments regarding your experience with particular features of PostgreSQL, clarifications of the documentation, or hints for other users. Please note, this is not a support forum, and your IP address will be logged. If you have a question or need help, please see the faq, try a mailing list, or join us on IRC. Note that submissions containing URLs or other keywords commonly found in 'spam' comments may be silently discarded. Please contact the webmaster if you think this is happening to you in error.
In order to submit a comment, you must have a community account.
* denotes required field