Text Size: Normal / Large

6.3. Connection Object: pgobject

Table of Contents
query -- execute a SQL command
reset -- reset the connection
close -- close the database connection
fileno -- return the socket used to connect to the database
getnotify -- get the last notify from the server
inserttable -- insert a list into a table
putline -- write a line to the server socket [DA]
getline -- get a line from server socket [DA]
endcopy -- synchronize client and server [DA]
locreate -- create a large object in the database [LO]
getlo -- build a large object from given OID [LO]
loimport -- import a file to a PostgreSQL large object [LO]

This object handles a connection to the PostgreSQL database. It embeds and hides all the parameters that define this connection, leaving just really significant parameters in function calls.

Some methods give direct access to the connection socket. They are specified by the tag [DA]. Do not use them unless you really know what you are doing. If you prefer disabling them, set the -DNO_DIRECT option in the Python Setup file.

Some other methods give access to large objects. if you want to forbid access to these from the module, set the -DNO_LARGE option in the Python Setup file. These methods are specified by the tag [LO].

Every pgobject defines a set of read-only attributes that describe the connection and its status. These attributes are:

host

the host name of the server (string)

port

the port of the server (integer)

db

the selected database (string)

options

the connection options (string)

tty

the connection debug terminal (string)

user

user name on the database system (string)

status

the status of the connection (integer: 1 - OK, 0 - bad)

error

the last warning/error message from the server (string)


User Comments

No comments could be found for this page.

Add Comment

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.

* Comment
 

* denotes required field

Privacy Policy | Project hosted by hub.org | Designed by tinysofa
Copyright © 1996 – 2007 PostgreSQL Global Development Group