summaryrefslogtreecommitdiff
path: root/psycopg
Commit message (Collapse)AuthorAgeFilesLines
* Allow importing _psycopg even if the 'errors' module is not availableDaniele Varrazzo2019-02-101-9/+23
|
* SQLSTATE error classes implemented in CDaniele Varrazzo2019-02-106-126/+516
| | | | The module is only used to export them to Python.
* Dropped PSYCOPG_DISPLAY_SIZE build parameterDaniele Varrazzo2019-01-252-143/+150
| | | | | Big and complex _pq_fetch_tuples simplified by moving per-column calculation to a separate function.
* Merge branch 'module-init-cleanup'Daniele Varrazzo2019-01-239-325/+282
|\
| * General cleanup of module init shenanigansmodule-init-cleanupDaniele Varrazzo2019-01-234-80/+90
| | | | | | | | | | | | Pass around the module instead of its dict (getting the latter is fast if needed), mark function raising with negative results, check all errors, consistent names...
| * Incref an object which will be held forever in a static varDaniele Varrazzo2019-01-231-0/+1
| |
| * Decrement the refcount of temporary objects in module init failedDaniele Varrazzo2019-01-221-6/+16
| | | | | | | | We are going to die anyway, but let's do it in style.
| * Date/time modules initialized in separate functionsDaniele Varrazzo2019-01-225-50/+68
| |
| * Dropped psyco_errors_fill()Daniele Varrazzo2019-01-211-19/+16
| | | | | | | | Just use psyco_errors_init() for complete errors initialization
| * Dropped project wide type to define encodings tableDaniele Varrazzo2019-01-212-19/+21
| |
| * Dropped C API interfaceDaniele Varrazzo2019-01-212-84/+4
| | | | | | | | | | I guess it was unused as it only contained two init functions. The Capsule should do things better now I guess.
| * Respect refcount with PyModule_AddObject()Daniele Varrazzo2019-01-211-87/+63
| | | | | | | | | | The function steals a ref. The module is never destroyed so things work fine but the refcount is wrong.
| * Module constants definition moved in a separate function for clarityDaniele Varrazzo2019-01-211-16/+39
| |
* | Assign the PGresult to the cursor in the execute critical sectionexecute-locksDaniele Varrazzo2019-01-221-4/+9
| | | | | | | | | | Possible cause of the issue reported in #346 (in concurrent environments).
* | Split pq_execute into sync/async partsDaniele Varrazzo2019-01-221-92/+119
|/
* Handle failed allocation in list adaptationcode-cleanupDaniele Varrazzo2019-01-211-1/+3
|
* Dropped funny handling of REPLICATION_* constantsDaniele Varrazzo2019-01-213-31/+8
|
* _psyco_curs_execute() simplifiedDaniele Varrazzo2019-01-211-53/+39
| | | | | | | Dropped code duplications, more regular increc/decref pattern. Check the return value of formatting named cursor: would have segfaulted in case of error.
* More straightforward semantics for psyco_GetDecimalTypeDaniele Varrazzo2019-01-212-6/+4
| | | | Raise an exception when returning NULL, leave the caller cleaning it.
* Dropped use of converter function to verify copy argumentDaniele Varrazzo2019-01-211-44/+25
| | | | They weren't really converters, and they confused the static checker
* Mark psyco_set_error as returning a borrowed objectDaniele Varrazzo2019-01-212-3/+2
|
* Added utils.h fileDaniele Varrazzo2019-01-214-140/+175
| | | | | | utils.c functions definition moved out of psycopg.h Some utility functions defined into psycopgmodule.c moved into utils.c.
* Mark setter as raising on negative resultsDaniele Varrazzo2019-01-213-6/+6
| | | | Fixed static check of psyco_conn_cursor().
* Consider the case dereferencing weakref in conn_poll returns NULLDaniele Varrazzo2019-01-211-1/+10
| | | | | It shouldn't but handle the case to avoid a possible null pointer dereferencing.
* Dropped possible wrong code path in conn_decodeDaniele Varrazzo2019-01-211-13/+15
| | | | | It shouldn't happen for both cdecoder and pydecoder to be null, but just in case...
* Wrap _Bytes_Resize into a function with clearer semanticDaniele Varrazzo2019-01-211-5/+19
| | | | Limit the static checker hacking to a simpler function.
* Avoid unlikely leaks in case of memory errors in Bytes_FormatDaniele Varrazzo2019-01-211-0/+4
|
* Move var setting into the only case using itDaniele Varrazzo2019-01-211-5/+2
| | | | | The original function was more complex than this. This refactoring avoids a false positive in the static checker
* Avoid using PyErr_BadInternalCall as the static checker doesn't get itDaniele Varrazzo2019-01-211-1/+1
|
* Use the real definition of Py_LOCAL_INLINEDaniele Varrazzo2019-01-211-4/+1
|
* Bytes_Format: use a couple of macros instead of functionsDaniele Varrazzo2019-01-211-3/+2
| | | | The type was already checked upstream in the func body.
* psycopg_escape_string: don't make me cringeDaniele Varrazzo2019-01-211-8/+8
| | | | Just reformatted.
* Stricter use of PyArg_ParseTuple typed objectsDaniele Varrazzo2019-01-212-7/+12
| | | | The function expect PyObject *, not subclasses.
* Respect PyCFunction signature in METH_NOARGS functionsDaniele Varrazzo2019-01-216-25/+25
| | | | A second parameter does exist, although it's always NULL.
* Added BYTESARRAY typecasterDaniele Varrazzo2019-01-182-2/+3
|
* Fixed typecast definition orderDaniele Varrazzo2019-01-181-1/+1
| | | | | Didn't notice that the order matter: the last typecaster registered is the effective one so let STRING win over UNICODE and BYTES.
* Preliminary test for a BYTES adapter.Daniele Varrazzo2019-01-182-9/+17
| | | | | Allow returning unparsed bytes from databases with mixed encodings. See issue #519.
* Don't call CLEARPGRES on the cursor state without holding the gilDaniele Varrazzo2019-01-021-2/+2
| | | | | | | There is a chance it is executed by two different threads resulting in issue #384. I havent't found any other case that may lead to double free.
* Merge pull request #821 from jdufresne/skip-libpqDaniele Varrazzo2018-12-041-5/+0
|\ | | | | Remove workarounds for unsupported libpq < 9.1
| * Remove workarounds for unsupported libpq < 9.1Jon Dufresne2018-12-011-5/+0
| | | | | | | | | | | | Per http://initd.org/psycopg/docs/install.html#prerequisites: > PostgreSQL client library version from 9.1
* | Simplify PyBool usage with Python convenience macros/functionsJon Dufresne2018-11-305-47/+12
|/ | | | https://docs.python.org/3/c-api/bool.html
* Convert int subclasses to long before adaptingDaniele Varrazzo2018-11-161-2/+21
| | | | | | | | | | | | Fixes adaptation of int/long subclasses whose str() is not the number, such IntEnum Close #591 Note that I thought it would have needed a new adapter, so I considered it a new feature. But it is more a shortcoming of the int adapter failing to do something reasonable (poor Liskov, always mistreated) so I may actually backport it if there is a new 2.7 release.
* Merge branch 'master' into feature-expose-pgconnFederico Di Gregorio2018-11-0713-107/+1223
|\
| * Fixed adaptation of lists of empty listsfix-788Daniele Varrazzo2018-10-301-1/+15
| | | | | | | | | | | | | | | | ...somehow. Postgres doesn't support them and converts them into a simple empty array. However this is not really our concern: the syntax we return is valid. Close #788
| * Merge branch 'connection-info'Daniele Varrazzo2018-10-156-17/+673
| |\
| | * Use the connection.info properties instead of the legacy methodsconnection-infoDaniele Varrazzo2018-10-131-1/+1
| | |
| | * Guard from some info functions not available in some libpq versionsDaniele Varrazzo2018-10-131-8/+37
| | |
| | * Added ConnectionInfo.parameter_status()Daniele Varrazzo2018-10-131-0/+36
| | |
| | * Added ConnectionInfo.ssl_attribute()Daniele Varrazzo2018-10-131-1/+79
| | |
| | * Added all the missing ConnectionInfo attributesDaniele Varrazzo2018-10-131-4/+118
| | |