Commit Graph

1792 Commits

Author SHA1 Message Date
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
362c2ae597 Release the GIL around PQgetResult calls after COPY
It should fix ticket #140.
2012-11-24 22:49:36 +00:00
Daniele Varrazzo
896ad7c827 Fixed a couple of terms in the docs
After Pierre-Louis Bonicoli's suggestions in ticket #138.
2012-11-12 01:32:38 +00:00
Daniele Varrazzo
10476200fd Added note about the adapted attribute in the module-level wrappers
Specifying it otherwise people expects the wrappers to have full datetime
semantics: see ticket #136.
2012-10-27 22:24:48 +01:00
Daniele Varrazzo
0837fc958e Merge branch 'fix-135' into maint_2_4 2012-10-21 22:02:39 +01:00
Daniele Varrazzo
e109024d39 Merge branch 'fix-135' into devel 2012-10-21 21:49:30 +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
1feb179fba 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
a33c0670fd 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
f5f2e2c092 Dropped redundant call to FixedOffsetTimezone.__init__ 2012-10-21 21:12:02 +01:00
Daniele Varrazzo
6b8861d2d5 Clarification in copy_expert docs
Closes ticket #134.
2012-10-15 00:47:22 +01:00
Daniele Varrazzo
71393b9ae9 Discard any result produced by cursor.executemany() 2012-10-11 22:29:03 +01:00
Daniele Varrazzo
4ddad45feb Discard any result produced by cursor.executemany() 2012-10-11 22:27:35 +01:00
Daniele Varrazzo
5fbf3ef147 Merge branch 'fix-113' into devel 2012-10-11 22:26:51 +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
ee763e0f47 Copyright bumped to 2012 in docs pages 2012-10-07 13:14:31 +01:00
Daniele Varrazzo
a666432329 Docs front page adjustments 2012-10-07 02:07:47 +01:00
Daniele Varrazzo
82dc32cebd Added install section to the manual 2012-10-07 02:04:39 +01:00
Daniele Varrazzo
b61a2a34c4 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-06 11:58:52 +01:00
Daniele Varrazzo
2611d62283 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-06 01:45:24 +01:00
Daniele Varrazzo
f4f67ad985 Dropped compiler warning on Py 2.4 2012-10-06 01:22:05 +01:00
Daniele Varrazzo
644b18a2c9 Dropped compiler warning on Py 2.4 2012-10-06 01:22:05 +01:00
Daniele Varrazzo
76815f1e92 Added compatibility PyErr_WarnEx macro for Python 2.4 2012-10-06 01:16:57 +01:00
Daniele Varrazzo
53b1c70f3a 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-06 01:10:41 +01:00
Daniele Varrazzo
2137db89d4 Added function conn_close_locked() 2012-10-06 01:03:12 +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
9f9da182f1 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
4244d5953a Merge branch 'range-type' into devel 2012-09-27 00:48:05 +01:00
Daniele Varrazzo
dda24f082f Merge branch 'json' into devel 2012-09-27 00:41:04 +01:00
Daniele Varrazzo
465b5cf280 Mention JSON adaptation in the NEWS file 2012-09-27 00:40:35 +01:00
Daniele Varrazzo
33043cd038 Merge branch 'composite-custom' into devel 2012-09-27 00:38:00 +01:00
Daniele Varrazzo
bc1d2f5d3a Merge remote-tracking branch 'github/connect-keywords' into devel 2012-09-26 13:15:33 +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
20d3d0f66d 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
cf3c6f86ff 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
cd316a94f1 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
b894539007 Fixed json doc error 2012-09-25 00:12:57 +01:00
Daniele Varrazzo
b8b669611e More helpful error messasge on Range order attempts 2012-09-25 00:07:08 +01:00
Daniele Varrazzo
7b1973354f Fixed SQL_IN when getquoted() is called without prepare() 2012-09-24 16:55:01 +01:00
Daniele Varrazzo
a733416241 Fixed SQL_IN when getquoted() is called without prepare() 2012-09-24 16:55:01 +01:00
Daniele Varrazzo
f70e6a1519 Grammar correction for RangeCaster.array_typecaster 2012-09-24 12:13:46 +01:00