summaryrefslogtreecommitdiff
path: root/psycopg/connection_int.c
Commit message (Collapse)AuthorAgeFilesLines
* Autocommit shouldn't change deferrable on servers not supporting itDaniele Varrazzo2018-02-081-2/+2
| | | | Regression on unsupported Postgres versions after fixing bug #580
* Fixed idempotence check changing connection characteristicsDaniele Varrazzo2018-01-111-9/+22
|
* Revert default_transaction_* to default only if setsession-attributesDaniele Varrazzo2017-02-161-9/+13
| | | | | | When moving from autocommit True -> False reset only the server parameters that were actually specified by psycopg to honour the serssion characteristics.
* Check for deferrable unsupported applied to attribute tooDaniele Varrazzo2017-02-161-1/+8
|
* Added readonly and deferrable attributesDaniele Varrazzo2017-02-161-13/+3
|
* Set default_transaction_* GUC if session state is changed in autocomitDaniele Varrazzo2017-02-041-3/+72
|
* Reuse set_session to implement autocommit, set_isolation_levelDaniele Varrazzo2017-02-041-49/+17
|
* Better separation between interface and state change codeDaniele Varrazzo2017-02-041-82/+12
| | | | The state change function has a C callable signature.
* Don't use default_transaction_* for session characteristicsDaniele Varrazzo2017-02-041-162/+118
| | | | | | | | | Store the state in the connection object and set the params on BEGIN Some tests fail: a few can be fixed reading transaction_* instead of default_transaction_*; but the behaviour of tx characteristics with autocommit is effectively changed. It may be addressed by setting default_transaction_* if autocommit is set.
* Use the proper API functions to look up codec functionsDaniele Varrazzo2016-12-291-10/+5
|
* Don't look up for Python encodingDaniele Varrazzo2016-12-291-89/+121
| | | | | | Store the encode/decode functions for the right codec in the connection. The Python encoding name has been dropped of the connection to avoid the temptation to use it...
* Store python encoding and decoding functions in the connectionDaniele Varrazzo2016-12-271-4/+66
| | | | Unused for now: will be used instead of 'pyenc', which is to be dropped.
* Setting connection encoding refactoredDaniele Varrazzo2016-12-261-51/+56
| | | | | | Code paths to read encoding on connection and to store the new connection in the structure after changing it in the backend unified into a single function.
* conn->codec rename to pyencDaniele Varrazzo2016-12-261-45/+45
|
* Merge branch 'master' into fast-codecsDaniele Varrazzo2016-12-261-8/+36
|\
| * Avoid deadlock on close if set datestyle failedDaniele Varrazzo2016-12-251-5/+11
| |
| * Dropped testing printDaniele Varrazzo2016-12-251-1/+0
| |
| * do not "SET datestyle" on replication connectionsChristoph Moench-Tegeder2016-10-211-3/+26
| | | | | | | | | | | | A replication connection - marked by the use of the keyword "replication" in the DSN - does not support SET commands. Trying to sent "SET datestyle" will result in an exception.
* | Optimize UTF8 and Latin1 decodingDaniele Varrazzo2016-10-121-0/+29
|/ | | | | Cache a pointer to a fast decoding function when the connection encoding is set so skip a repeated codec lookup for every string.
* Allow connection.notices and notifies to be replaced.Daniele Varrazzo2015-06-021-18/+51
| | | | Close #326
* Pending notice list converted into a forward listDaniele Varrazzo2015-06-021-7/+11
| | | | This allows inserting the elements in order without using list.insert().
* Dropped unneeded constness on the notice messageDaniele Varrazzo2015-06-021-1/+1
| | | | That's a strdup result, we 0wn it.
* Fixed dsn and closed attributes in failing connection subclasses.Daniele Varrazzo2014-04-031-3/+12
| | | | From ticket #192 discussion.
* Set the connection async before polling for connectionDaniele Varrazzo2014-02-241-5/+5
| | | | It should fix ticket #194
* Set the connection async earlier in green modeDaniele Varrazzo2014-02-241-4/+3
| | | | | | The moment it is called shouldn't have really changed, but it's more explicit when it happens. Previously it was sort of obfuscated behind a roundtrip through the green callback and poll.
* Meaningful connection errors report a meaningful messageDaniele Varrazzo2013-10-161-1/+6
| | | | Fixes issue #173.
* Fix multiple misspellingsPiotr Kasprzyk2013-04-261-2/+2
|
* Fixed leak of cancel key on connection.reset()Daniele Varrazzo2013-03-201-14/+18
| | | | | Moving the final free into the destructor is not necessary but looks appropriate.
* Dropped IFCLEARPGRES macroDaniele Varrazzo2013-03-201-1/+1
| | | | PQclear already guards against NULL, so the extra check is redundant
* Notify and Xid objects and types renamed for consistencyDaniele Varrazzo2013-03-201-3/+3
| | | | They were the only objects starting with uppercase. My fault.
* Properly cleanup memory of broken connectionsDaniele Varrazzo2013-03-161-2/+5
| | | | Fixed ticket #148.
* Discard any result produced by cursor.executemany()Daniele Varrazzo2012-10-111-1/+1
|
* Added function conn_close_locked()Daniele Varrazzo2012-10-061-7/+17
|
* Merge branch 'gcc-python-plugin' into develDaniele Varrazzo2012-03-051-35/+47
|\
| * More functions annotated for static analysisDaniele Varrazzo2012-03-011-7/+7
| | | | | | | | | | 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-18/+9
| |
| * Functions setting exception return a negative value on errorDaniele Varrazzo2012-03-011-18/+24
| | | | | | | | | | This works around another shortcoming of the static checker; also to be discussed with the author.
| * Use the newly provided attributes to validate exceptions raisingDaniele Varrazzo2012-03-011-1/+8
| | | | | | | | | | Be more consistent in using 0 for success, <0 for failure, and to check for values < 0 instead of specific -1.
| * Fixed possible NULL dereferencing in notice processDaniele Varrazzo2012-02-241-2/+10
| |
* | close() methods don't raise errors if called on closed objectsDaniele Varrazzo2012-03-041-4/+7
|/
* Put back a distinct ISOLATION_LEVEL_READ_UNCOMMITTED valueDaniele Varrazzo2011-12-151-10/+13
|
* Reverted isolation level values to backward compatible valuesFederico Di Gregorio2011-12-151-7/+6
| | | | | | | | This basically removes the READ UNCOMMITED level (that internally PostgreSQL maps to READ COMMITED anyway) to keep the numeric values compattible with old psycopg versions. For full details and discussion see this thread: http://archives.postgresql.org/psycopg/2011-12/msg00008.php
* Method set_transaction() renamed to set_session()Daniele Varrazzo2011-06-081-5/+5
| | | | | | In fact it doesn't change "the transaction", as there has to be no transaction when invoked. The effect instead is to execute SET SESSION CHARACTERISTICS.
* Merge branch 'guc-cleanup' into develDaniele Varrazzo2011-06-051-74/+94
|\
| * Use the pqpath functions to get/set GUC parametersDaniele Varrazzo2011-06-051-74/+94
| | | | | | | | | | | | | | | | | | Functions conn_setup(), conn_get_isolation_level(), conn_set_transaction(), conn_switch_isolation_level(), conn_set_client_encoding() reimplemented using the pqpath funtitons. Dropped analogous function in the connection, as it had to take the lock, thus it was hard to build consistent pieces of functionality with it.
* | Avoid a deadlock using concurrent green threads on the same connectionDaniele Varrazzo2011-06-051-1/+1
|/ | | | | Use the async_cursor property to store an indication that something is running (even if it is not necessarily a cursor running the query).
* Cleanup of notice processingDaniele Varrazzo2011-06-041-14/+5
| | | | | | | | | The function is always called in the context of functions grabbing the connection lock, so just use the same critical section instead of releasing and re-acquiring it. It is not a problem as serious as the notifies process (ticket #55) as the notices are a psycopg structure, not libpq. However the change allows again processing notices/notifies in the same place, which makes sense conceptually, plus we save some lock dance.
* Process notifies when data is received, not when the result is parsedDaniele Varrazzo2011-06-041-2/+0
| | | | | | | Notifies process access the connection, is not limited to the result, so There is the possibility of loss of protocol sync in multithread programs. Closes ticket #55.
* Use only the isolation levels available on old PG versionsDaniele Varrazzo2011-06-031-0/+7
|
* Dropped isolation level from the connection objectDaniele Varrazzo2011-06-031-50/+113
| | | | | | | | | | Don't issue a SET TRANSACTION ISOLATION LEVEL at every begin: use PG's GUC default, eventually set by set_transaction. Dropped the last query at connection, yay! Method set_isolation_level() and property isolation_level refactored using the new structures, keeping the previous semantic.