Allows Python code to execute PostgreSQL command in a database session. Cursors are created by the connection.cursor() method: they are bound to the connection for the entire lifetime and all the commands are executed in the context of the database session wrapped by the connection.
Cursors created from the same connection are not isolated, i.e., any changes done to the database by a cursor are immediately visible by the other cursors. Cursors created from different connections can or can not be isolated, depending on the connections’ isolation level. See also rollback() and commit() methods.
Cursors are not thread safe: a multithread application can create many cursors from the same connection and should use each cursor from a single thread. See Thread and process safety for details.
This read-only attribute is a sequence of 7-item sequences.
Each of these sequences is a named tuple (a regular tuple if collections.namedtuple() is not available) containing information describing one result column:
This attribute will be None for operations that do not return rows or if the cursor has not had an operation invoked via the execute*() methods yet.
Changed in version 2.4: if possible, columns descriptions are named tuple instead of regular tuples.
Close the cursor now (rather than whenever del is executed). The cursor will be unusable from this point forward; an InterfaceError will be raised if any operation is attempted with the cursor.
Read-only boolean attribute: specifies if the cursor is closed (True) or not (False).
DB API extension
The closed attribute is a Psycopg extension to the DB API 2.0.
New in version 2.0.7.
Read-only attribute returning a reference to the connection object on which the cursor was created.
Read-only attribute containing the name of the cursor if it was creates as named cursor by connection.cursor(), or None if it is a client side cursor. See Server side cursors.
DB API extension
The name attribute is a Psycopg extension to the DB API 2.0.
Commands execution methods
Prepare and execute a database operation (query or command).
Parameters may be provided as sequence or mapping and will be bound to variables in the operation. Variables are specified either with positional (%s) or named (%(name)s) placeholders. See Passing parameters to SQL queries.
The method returns None. If a query was executed, the returned values can be retrieved using fetch*() methods.
Prepare a database operation (query or command) and then execute it against all parameter tuples or mappings found in the sequence seq_of_parameters.
The function is mostly useful for commands that update the database: any result set returned by the query is discarded.
Parameters are bounded to the query using the same rules described in the execute() method.
Call a stored database procedure with the given name. The sequence of
parameters must contain one ll J4WMȇJ5uω@;t5SmlcR{Zmo]]COq̵ry,7+TRO'߇L{xZvzl,VN0a0W\1ir=)
+S4=ܫ3Y ϗ4sZ$h0Ej??@ߐw}6R}'ߍ͓ш.ǠUK7Vh+ҼQ4ЬFXoX/:nyCe"sMбiHAejN ¤`k10t02xռ?.'46X XoRH.fn)Pn"?/xF=yQh55=Uf謯d @.HS$%Eu
3|0ظ*zT9YPQHP(8y-J+myASV'n>joq˂dW-
Pj$k3yet^%w2"4eJZ'eD@l@njS¸7}vdֱR'o _QV$HдC<6v&g!ΣRQVD.XʫfVgZ@؞Ӓ`n*0xCrYPsYi*DxhG&fA3Uh()"pVFؕT\A)\=3%q|쵲,XrzMY0L{R7uB