summaryrefslogtreecommitdiff
path: root/psycopg/pqpath.h
Commit message (Collapse)AuthorAgeFilesLines
* Drop ReplicationCursor.flush_feedback(), rectify pq_*_replication_*() interface.Oleksandr Shulgin2015-10-231-2/+4
|
* Move the `decode` parameter to `start_replication()`.Oleksandr Shulgin2015-10-231-2/+2
| | | | | It makes more sense this way, because otherwise it must be passed to every call of `read_message()`.
* Properly subclass ReplicationCursor on C level.Oleksandr Shulgin2015-10-191-3/+5
|
* Rework replication connection/cursor classesOleksandr Shulgin2015-10-011-0/+2
|
* Rework replication protocolOleksandr Shulgin2015-06-301-0/+3
| | | | | | | | | This change exposes lower level functions for operating the (logical) replication protocol, while keeping the high-level start_replication function that does all the job for you in case of a synchronous connection. A number of other changes and fixes are put into this commit.
* No implicit transaction on named cursor closeAlexey Borzenkov2014-08-211-1/+1
| | | | | | Also, don't start an implicit transaction when fetching with named with hold cursor, since it already returns results from a previously committed transaction.
* Dropped IFCLEARPGRES macroDaniele Varrazzo2013-03-201-3/+2
| | | | PQclear already guards against NULL, so the extra check is redundant
* Discard any result produced by cursor.executemany()Daniele Varrazzo2012-10-111-2/+3
|
* More functions annotated for static analysisDaniele Varrazzo2012-03-011-1/+1
| | | | | Also more return values checked for values < 0 for errors, instead of checking == 0 and leaving the positive side unchecked
* Use more compact macros to annotate functions for the static checkerDaniele Varrazzo2012-03-011-12/+6
|
* Use the newly provided attributes to validate exceptions raisingDaniele Varrazzo2012-03-011-0/+6
| | | | | Be more consistent in using 0 for success, <0 for failure, and to check for values < 0 instead of specific -1.
* Added pqpath functions to get/set the value for GUC parametersDaniele Varrazzo2011-06-051-0/+6
| | | | | | | The aim of these function is to allow the connection to make a better use of the pqpath functions instead of using PQexec for these small things. Also, the functions are to be called with the connection lock: this makes composing higher level functions using them easier.
* Set hidden visibility to a few functions not publicDaniele Varrazzo2011-02-191-0/+2
|
* Internal imports simplified.Daniele Varrazzo2010-12-121-1/+0
| | | | | | | | | | .c files only need to import psycopg.h: it will in turn import dependencies from Python and libpq and configure.h. psycopg.h should be the first to be imported, so the basic imports are not required in the .h's As a guideline I'm trying to import from the most specific to the most generic to detect missing imports in the .h's.
* Keep the GIL while converting the xid into the PostgreSQL transaction id.Daniele Varrazzo2010-11-051-1/+1
|
* Added tpc_prepare and CONN_STATUS_PREPARED.Daniele Varrazzo2010-11-051-0/+4
|
* poll implementation for async, sync and green connection unified.Daniele Varrazzo2010-04-231-0/+1
|
* Added a function to advance the state after a read attempt.Daniele Varrazzo2010-04-231-0/+1
| | | | Dropped calls to PQisBusy/PQconsumeInput in the connection code.
* Added 'pq_get_last_result()' function.Daniele Varrazzo2010-04-231-0/+1
| | | | The function reads the last result after an asynchronous query.
* 'pq_execute_command_locked()' calls the wait callback if set.Daniele Varrazzo2010-04-211-3/+4
| | | | | | | The function is called without holding the GIL. Because it is necessary to execute the Python callback if set, we need to re-acquire the GIL and tnen release it again. In order to correctly bookkeep the thread state, the pointer of the _save variable is passed to the function.
* Added pq_set_non_blocking utility function.Daniele Varrazzo2010-04-071-0/+1
|
* Add pq_flush, a function to flush the output bufferJan Urbański2010-04-051-0/+1
|
* Make pq_clear_async clear the whole pending result and export itJan Urbański2010-04-051-0/+1
|
* Changes license to LGPL3 + OpenSSL exception on all source filesFederico Di Gregorio2010-02-121-12/+16
|
* Implemented connection.reset()Federico Di Gregorio2009-08-091-0/+1
|
* Some changes to the lobject code to match changes in pqpath.[ch].James Henstridge2008-05-051-0/+2
|
* * psycypg/*.h: apply HIDDEN to all global variables and functionsJames Henstridge2008-01-211-9/+10
| | | | | | | | that should not be exported from the module. This results in a 5% reduction in code size and shortens the dynamic symbol table. * psycopg/config.h: If GCC >= 4.0 is installed, define the HIDDEN symbol to apply the "hidden" visibility attribute.
* * psycopg/pqpath.c (pq_raise): remove unused arguments toJames Henstridge2008-01-191-1/+0
| | | | | | function, and simplify. (pq_resolve_critical): make function static, since it isn't being used outside of pqpath.c any more.
* * psycopg/connection_int.c (conn_close): fix for newJames Henstridge2008-01-101-1/+9
| | | | | | | | | | | | | pq_abort_locked() prototype. (conn_switch_isolation_level): fix for new pq_abort_locked() prototype, and use pq_complete_error() to show error message. (conn_set_client_encoding): same here. * psycopg/pqpath.c (pq_execute_command_locked): remove static modifier. (pq_complete_error): same here. (pq_abort_locked): add pgres and error arguments. (pq_abort): call pq_abort_locked() to reduce code duplication.
* 2007-12-23 James Henstridge <james@jamesh.id.au>James Henstridge2008-01-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * psycopg/pqpath.c (pq_execute_command_locked): add an error argument to hold an error when no PGresult is returned by PQexec, rather than using pq_set_critical(). (pq_complete_error): new function that converts the error returned by pq_execute_command_locked() to a Python exception. (pq_begin_locked): add error argument. (pq_commit): use pq_complete_error(). (pq_abort): use pq_complete_error(). (pq_abort_locked): always call pq_set_critical() on error, and clear the error message from pq_execute_command_locked(). (pq_execute): use pq_complete_error() to handle the error from pq_begin_locked(). * psycopg/pqpath.c (pq_begin): remove unused function. * psycopg/connection_type.c (psyco_conn_commit): if conn_commit() raises an error, just return NULL, since it is now setting an exception itself. (psyco_conn_rollback): same here. * psycopg/connection_int.c (conn_commit): don't drop GIL and lock connection before calling pq_commit(). (conn_rollback): same here. (conn_close): use pq_abort_locked(). (conn_switch_isolation_level): same here. (conn_set_client_encoding): same here. * psycopg/pqpath.h: add prototype for pq_abort_locked(). * psycopg/pqpath.c (pq_commit): convert function to run with GIL held, and handle errors appropriately. (pq_abort): same here. (pq_abort_locked): new function to abort a locked connection. 2007-12-22 James Henstridge <james@jamesh.id.au> * psycopg/pqpath.c (pq_raise): add a "pgres" argument so we can generate nice errors not related to a particular cursor. (pq_execute): use pq_begin_locked() rather than pq_begin(). Use pq_raise() to handle any errors from it. * psycopg/pqpath.c (pq_execute_command_locked): helper function used to execute a command-style query on a locked connection. (pq_begin_locked): a variant of pq_begin() that uses pq_execute_command_locked(). (pq_begin): rewrite to use pq_begin_locked().
* * psycopg/pqpath.c (pq_raise): only remove the first 8 charactersJames Henstridge2007-12-191-0/+1
| | | | | | | | | | | | | | | | | of the exception message if it actually gives the severity. * psycopg/pqpath.h (pq_resolve_critical): add prototype, since this function is being used from connection_int.c. * psycopg/psycopg.h: update psyco_set_error() prototype. * psycopg/psycopgmodule.c (psyco_errors_init): set pgerror, pgcode and cursor class attributes to None on psycopg2.Error so that the attributes will always be available (simplifies error handling). (psyco_set_error): add const qualifiers to msg, pgerror and pgcode arguments. Don't bother setting pgerror, pgcode or cursor to None if they are not provided -- the class defaults take care of this.
* Initial psycopg 2 import after SVN crash.Federico Di Gregorio2004-10-191-0/+41