summaryrefslogtreecommitdiff
path: root/psycopg/psycopgmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* Avoid quoting the string in the psycopg version macroDaniele Varrazzo2018-02-191-2/+6
| | | | | | | Use a macro trick to add the quotes. This seems more portable than passing the quotes to the command line (see #658). https://gcc.gnu.org/onlinedocs/cpp/Stringizing.html
* Added async_ as an alias for asyncDaniele Varrazzo2017-02-031-4/+6
| | | | | Added in argument for psycopg2.connect() and connection.__init__, and for the connection.async attribute.
* Use -1 instead of 0 to say "calculate the length" in many funcsDaniele Varrazzo2016-12-271-6/+2
| | | | 0 is a valid length, isn't it?
* Merge branch 'master' into named-callprocDaniele Varrazzo2016-12-261-1/+1
|\
* \ Merge branch 'master' into named-callprocDaniele Varrazzo2016-12-261-23/+29
|\ \ | |/
| * Dropped ifdef guards against obsolete libpq versionsDaniele Varrazzo2016-08-151-7/+0
| | | | | | | | | | One of them was actually wrong: lobject_type.c wouldn't have compiled pre 8.3 (broken in 6e841a41, 2 years ago).
| * Merge branch 'master' into replication-protocolDaniele Varrazzo2016-08-071-19/+3
| |\ | | | | | | | | | | | | Conflicts: tests/testconfig.py
| | * Merge branch 'conn-get-parameters'Daniele Varrazzo2016-07-011-19/+3
| | |\
| | | * Add connection.get_dsn_parameters()Oleksandr Shulgin2015-10-301-19/+3
| | | |
| * | | Remove some dead codeOleksandr Shulgin2016-03-081-1/+1
| | | |
| * | | Use python-defined make_dsn() for ReplicationConnection classOleksandr Shulgin2016-03-081-202/+7
| | | |
| * | | Merge branch 'master' into feature/replication-protocol-c-connection-objectOleksandr Shulgin2016-03-041-2/+3
| |\ \ \ | | |/ /
| | * | Validate output result from make_dsn()Daniele Varrazzo2016-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | The output is not necessarily munged anyway: if no keyword is passed, validate the input but return it untouched.
| | * | Added parse_dsn() docstringDaniele Varrazzo2016-03-031-1/+2
| | |/
| * | Move replication connection to C level.Oleksandr Shulgin2015-10-271-1/+11
| | |
| * | Merge branch 'feature/connect2' into feature/replication-protocolOleksandr Shulgin2015-10-271-7/+203
| |\ \
| | * | Rework psycopg2.connect() interface.Oleksandr Shulgin2015-10-271-7/+203
| | |/
| * | Properly subclass ReplicationCursor on C level.Oleksandr Shulgin2015-10-191-2/+7
| | |
| * | Merge branch 'master' into feature/replication-protocolOleksandr Shulgin2015-10-151-1/+62
| |\ \ | | |/
| * | Add psyco_curs_datetime_initOleksandr Shulgin2015-10-141-0/+1
| | |
| * | Merge remote-tracking branch 'origin/master' into replOleksandr Shulgin2015-10-011-0/+55
| |\ \
| * \ \ Merge branch 'master' into feature/replication-message-objectOleksandr Shulgin2015-06-301-1/+17
| |\ \ \ | | | | | | | | | | | | | | | | | | | | Conflicts: lib/extensions.py
| * | | | Expose ReplicationMessage type in extrasOleksandr Shulgin2015-06-111-0/+1
| | | | |
| * | | | Add handling of send_time field in replmsgOleksandr Shulgin2015-06-101-0/+1
| | | | |
| * | | | Add ReplicationMessage objectOleksandr Shulgin2015-06-051-0/+4
| | | | |
* | | | | Return input tuple in cur.callproc, factor code to use PQescapeIdentifier in ↵mrmilosz2015-12-131-8/+1
| |_|_|/ |/| | | | | | | | | | | single place
* | | | Proper unicode handling in quote_ident.Oleksandr Shulgin2015-10-151-9/+29
| | | |
* | | | Add psycopg2.extensions.quote_ident.Oleksandr Shulgin2015-10-141-0/+38
| | | |
* | | | Decref the ssl module after importingDaniele Varrazzo2015-10-011-1/+4
| |_|/ |/| |
* | | Added unicode support to parse_dsnDaniele Varrazzo2015-10-011-24/+27
| | | | | | | | | | | | Also added support for the argument as a keyword.
* | | Merge branch 'master' into feature/parse-dsnOleksandr Shulgin2015-06-021-1/+17
|\ \ \ | | |/ | |/| | | | | | | Conflicts: lib/extensions.py
| * | Dropped PG_VERSION_HEX constantDaniele Varrazzo2015-06-021-2/+2
| | | | | | | | | | | | At PostgreSQL 10.0 it would have become awkward.
| * | Add libpq version discoveryOleksandr Shulgin2015-06-011-0/+16
| |/
* | Move parse_dsn to extensions, add testsOleksandr Shulgin2015-06-011-13/+25
| |
* | Add parse_dsn module functionOleksandr Shulgin2015-06-011-0/+40
|/ | | | | | | | Calls PQconninfoParse to parse the dsn into a list of keyword and value structs, then constructs a dictionary from that. Can be useful when one needs to alter some part of the the connection string reliably, but doesn't want to get into all the details of parsing a dsn string: quoting, URL format, etc.
* Make sure libcrypto threadsafety callbacks are properly set upJan Urbański2015-05-031-0/+23
| | | | | | | | | | | | | | | | Multithreaded programs using libcrypto (part of OpenSSL) need to set up callbacks to ensure safe execution. Both Python and libpq set up those callbacks, which might lead to a conflict. To avoid leaving dangling function pointers when being unloaded, libpq sets up and removes the callbacks every time a SSL connection it opened and closed. If another Python thread is performing unrelated SSL operations (like connecting to a HTTPS server), this might lead to deadlocks, as described in http://www.postgresql.org/message-id/871tlzrlkq.fsf@wulczer.org Even if the problem will be remediated in libpq, it's still useful to have it fixed in psycopg2. The solution is to use Python's own libcrypto callbacks and completely disable handling them in libpq.
* Make Column picklable on Python >= 3.3Daniele Varrazzo2015-02-081-3/+19
| | | | | Also expose the type from the extensions module, not from the main module.
* Allow pickling of cursor.descriptionOwen Raccuglia2015-02-081-0/+1
| | | | | | | | | This is for people using dtuple.py; a dtuple.DatabaseTuple instance keeps a reference to cursor.description, which is not picklable because psycopg2 doesn't export the Column namedtuple it uses. This commit exports the Column namedtuple, and includes a test to verify the pickle/unpickle works after exporting Column.
* Don't import psycopg2.tz into the C extensionDaniele Varrazzo2014-08-281-17/+0
| | | | | | | | | | | | | | | | | | | This makes possible to import _psycopg directly, after adding the package directory to the pythonpath. This enables hacks such as: sys.path.insert(0, '/path/to/psycopg2') import _psycopg sys.modules['psycopg2._psycopg'] = _psycopg sys.path.pop(0) which can work around e.g. the problem of #201, freeze that cannot freeze psycopg2. Well, freeze cannot freeze it because it's just not designed to deal with C extensions. At least now the frozen application can hack the pythonpath and work around the limitation by importing _psycopg as above and then doing the rest of the imports normally. Keeping long-lived references to python objects is bad anyway: the tz module couldn't be reloaded before.
* Dropped PSYCOPG_EXTENSIONS flagDaniele Varrazzo2014-08-231-10/+0
| | | | | | Building without extensions has been long broken and nobody really cares about a pure-DBAPI implementation (which could be created using a wrapper instead).
* Dropped simple type wrapper functionsDaniele Varrazzo2014-08-151-16/+8
| | | | | These functions don't need to exist: exposing the type in the module is enough. It is actually better as one may use isinstance and such.
* Fix multiple misspellingsPiotr Kasprzyk2013-04-261-1/+1
|
* Fixed build on windowsDaniele Varrazzo2013-04-061-3/+7
| | | | Will fail with error: initializer element is not constant
* Use the Py_RETURN_NONE macroDaniele Varrazzo2013-04-051-2/+1
|
* PyType_GenericAlloc is the default allocator: no need to specifyDaniele Varrazzo2013-03-201-45/+34
|
* Notify and Xid objects and types renamed for consistencyDaniele Varrazzo2013-03-201-8/+8
| | | | They were the only objects starting with uppercase. My fault.
* psycopg2.Error object and type renamed more consistentlyDaniele Varrazzo2013-03-201-7/+7
|
* Store a PGresult in the Exception errorDaniele Varrazzo2013-03-191-17/+9
| | | | | This makes the Diagnostics independent from further operations on the cursor and allows using it with exceptions not generated by a cursor.
* Added a C structure to psycopg.ErrorDaniele Varrazzo2013-03-191-114/+17
| | | | This will allow to store a PGresult in it.
* Work-in-progress support for retrieving PG_DIAG result error fields.Matthew Woodcraft2013-03-171-0/+13
|