Commit Graph

1377 Commits

Author SHA1 Message Date
Daniele Varrazzo
5a55339e11 Really test named cursors in test_scroll_named() 2014-04-07 17:40:32 +01:00
Daniele Varrazzo
970bb1d1b1 Document that named cursors don't raise an exception going out-of-bound
See issue #174 for the details.

Conflicts:

	doc/src/cursor.rst
2014-04-07 17:40:17 +01:00
Daniele Varrazzo
b95bb2c641 Document that using %, (, ) in the placeholder name is not supported 2014-04-07 17:38:26 +01:00
Daniele Varrazzo
fb5e14c701 Meaningful connection errors report a meaningful message
Fixes issue #173.

Conflicts:

	NEWS
2014-04-07 17:38:17 +01:00
Daniele Varrazzo
00c1d867c2 Added regression test for infinity parsing in dates
...and a couple of typos.
2014-04-07 17:30:58 +01:00
Daniele Varrazzo
0914323328 Added test to verify copysize handling in copy_expert
Not an original psycopg2 bug but present in pure python implementation,
e.g. ctypes issue #25 and cffi issue #5.

https://github.com/mvantellingen/psycopg2-ctypes/issues/25
https://github.com/chtd/psycopg2cffi/pull/5
2014-04-07 17:29:50 +01:00
Daniele Varrazzo
d0f49f9887 Skip tests on python implementations without getrefcount()
PyPy is one of these.

Conflicts:

	tests/test_cursor.py
	tests/test_module.py
2014-04-07 17:29:36 +01:00
Daniele Varrazzo
50b68aa987 Merge branch 'solaris-round' into maint_2_4 2014-04-07 17:23:33 +01:00
Daniele Varrazzo
75947a6fef Mention Solaris round fix in NEWS file 2014-04-07 17:19:47 +01:00
Daniele Varrazzo
0973d02b4b Long ifdef reformatted for readibility 2014-04-07 17:16:52 +01:00
Daniel Enman
5eefec4f5e Remove extra || 2014-04-07 17:16:34 +01:00
Daniel Enman
eafcc650c8 Solaris 10+, and illumos distros have round() 2014-04-07 17:16:29 +01:00
Daniele Varrazzo
6ab195d957 The UUID adapter returns bytes instead of str in Python 3
Also added __conform__ method to the adapter.
2014-04-07 17:15:47 +01:00
Daniele Varrazzo
cdbcd8a2e5 Script to test ticket #58 moved into sandbox
We don't need it distributed in the sdist
2014-04-07 17:15:23 +01:00
Piotr Kasprzyk
5a74117118 Fix multiple misspellings
Conflicts:

	NEWS
	doc/src/usage.rst
	psycopg/pqpath.c
	setup.cfg
2013-04-26 10:17:17 +01:00
Daniele Varrazzo
802381358a Fixed broken test decorator preventing 3 tests to run 2013-03-20 17:33:42 +00:00
Daniele Varrazzo
0f8de70e59 Fixed leak of cancel key on connection.reset()
Moving the final free into the destructor is not necessary but looks
appropriate.
2013-03-20 16:49:52 +00:00
Daniele Varrazzo
1cb78f1cc4 Fixed bad interaction of setup.py with other dependencies
The problem is in Distribute dependencies on Python 3. Create a new command
class instead of changing inplace the one other projects may use.

Close ticket #153.
2013-03-20 12:21:36 +00:00
Daniele Varrazzo
c111ef5dff Properly cleanup memory of broken connections
Fixed ticket #148.
2013-03-20 11:45:17 +00:00
Daniele Varrazzo
4f85b50cd2 Bump to next maintenance release 2013-03-20 11:43:29 +00:00
Daniele Varrazzo
4e65ca1d8d Version bumped to 2.4.6 2012-12-11 01:40:02 +00:00
Daniele Varrazzo
67445dfbea Fixed pickling of DictRow objects too 2012-12-11 01:40:02 +00:00
Daniele Varrazzo
5bee4d3379 Fixed pickling of RealDictRow objects 2012-12-11 01:40:02 +00:00
Daniele Varrazzo
a64fd31fd1 Fixed connections re-init across ZSQL methods
Fixes issue #142, probably #123 and #125 too.
2012-12-03 16:49:55 +00:00
Daniele Varrazzo
0653861bc4 Fixed empty strings handling in composite caster
Closes ticket #141.
2012-12-03 14:20:08 +00:00
Daniele Varrazzo
bf45539585 Added specific pool implementation for ZPsycopgDA
The implementation is based on psycopg 2.4, which should be less broken
(zope-wise) of the current one.

Instantiating psycopg2.pool.PersistentConnectionPool now raises a warning.

This should fix ticket #123, #125. The issue of the reset on
set_client_encoding() is still present but that's always been there and I'm no
good at fixing it.
2012-12-03 00:37:02 +00:00
Daniele Varrazzo
fb24777200 Use set_session instead of set_isolation_level where available
Avoid spurious queries as reported in psycopg2 ticket #125.
2012-12-02 23:51:26 +00:00
Daniele Varrazzo
f9bcbc213e Show all the available isolation levels in ZPsycopgDA menu 2012-12-02 23:27:21 +00:00
Daniele Varrazzo
6fb0b001b2 Added 2.4.6 to the allowed versions for ZPsycopgDA
Dropped beta versions and the versions with the messed up isolation level
constants.
2012-12-02 22:46:55 +00:00
Daniele Varrazzo
f6054c28d8 Release the GIL around PQgetResult calls after COPY
It should fix ticket #140.
2012-11-24 22:51:23 +00:00
Daniele Varrazzo
0837fc958e Merge branch 'fix-135' into maint_2_4 2012-10-21 22:02:39 +01:00
Daniele Varrazzo
5e6eabd9f8 Fixed pickling of FixedOffsetTimezone objects
I have also verified that the fixed class can unpickle instance pickled with
the buggy one and viceversa.

Fixes ticket #135.
2012-10-21 21:47:32 +01:00
Daniele Varrazzo
790843a48a More idiomatic way to call FixedOffsetTimezone.__new__ superclass 2012-10-21 21:16:52 +01:00
Daniele Varrazzo
e4a07c3a30 Dropped redundant call to FixedOffsetTimezone.__init__ 2012-10-21 21:12:02 +01:00
Daniele Varrazzo
4ddad45feb Discard any result produced by cursor.executemany() 2012-10-11 22:27:35 +01:00
Daniele Varrazzo
20d3344972 Merge branch 'fix-113' into maint_2_4 2012-10-09 02:02:28 +01:00
Daniele Varrazzo
58d048198f Close the connection on error in callback
Unfortunately PQcancel blocks, so it's not better than PQgetResult.
It has been suggested to use PQreset in non-blocking way but this would give
the Python program the burden of handling a connection done but not configured
in an unexpected place.
2012-10-09 02:01:29 +01:00
Daniele Varrazzo
7632e1ae46 Get the result from the connection after the green panic
Otherwise the connection won't be usable in case we manage
to put it back on track (libpq reports "another command is
already in progress")
2012-10-09 02:01:29 +01:00
Daniele Varrazzo
6b6aded90b Added compatibility PyErr_WarnEx macro for Python 2.4 2012-10-09 02:01:29 +01:00
Daniele Varrazzo
fa032f09fb Attempt to fix issue #113.
If the network is down, trying to read blocking will hang the process hard
(ctrl-c not working). Send a cancel signal instead (as suggested in
http://archives.postgresql.org/pgsql-hackers/2012-07/msg00903.php) and go
back into a green polling: this should allow a further error (e.g. another
ctrl-c) to break the loop. In this case we cannot assume anything about
the state of the connection, so we close it.
2012-10-09 02:01:29 +01:00
Daniele Varrazzo
6d1b3b21e6 Added function conn_close_locked() 2012-10-09 02:01:29 +01:00
Daniele Varrazzo
f4f67ad985 Dropped compiler warning on Py 2.4 2012-10-06 01:22:05 +01:00
Daniele Varrazzo
387b7b6b36 Using super() in the connection/cursor subclasses
This opens to collaborative subclassing (e.g. you may want to have a
logging namedtuple cursor...)
2012-09-28 02:51:58 +01:00
Daniele Varrazzo
74e6efd717 Raise TypeError instead of InterfaceError on bad params on connect()
TypeError is the standard Python error raised in this case:

    $ python -c "(lambda a: None)(b=10)"
    TypeError: <lambda>() got an unexpected keyword argument 'b'

We only used to raise InterfaceError when connect was used without
any parameter at all, so it's hard to think a program depending on
that design. Furthermore the function has always raised (and still
does) OperationalError too, if the bad argument is detected by the
libpq, and that cannot be changed because we can't tell the
difference from a normal connection error.
2012-09-26 11:55:21 +01:00
Daniele Varrazzo
bc68b2ff1e Improved error message on connect when kwargs are passed together with dns 2012-09-26 11:47:06 +01:00
Daniele Varrazzo
32fae728b3 Dropped quirks in connection arguments handling
Now connect() raises an exception instead of swallowing keyword arguments
when a connection string is specified as well

Closes ticket #131.
2012-09-25 23:46:46 +01:00
Daniele Varrazzo
a733416241 Fixed SQL_IN when getquoted() is called without prepare() 2012-09-24 16:55:01 +01:00
Daniele Varrazzo
d183657c11 Info about hstore versions history moved from code to docs 2012-09-22 02:10:58 +01:00
Daniele Varrazzo
c7bee92160 Fixed infinite loop when parsing '{' as array 2012-09-20 03:19:24 +01:00
Daniele Varrazzo
72e9cf7b6d Fixed return value after malformed arrays 2012-09-10 04:20:39 +01:00