Commit Graph

862 Commits

Author SHA1 Message Date
Daniele Varrazzo
2480f587e1 Added warning note about equivalence inconsistence between Notify and tuples. 2010-11-05 09:34:52 +00:00
Daniele Varrazzo
77c0ab02d8 The Notify type is hashable.
If there is no payload, hash the same way the equivalent 2-tuple does.
Otherwise hash on the payload too.
2010-11-05 09:34:52 +00:00
Daniele Varrazzo
56ae1fe4bf Payload default is the empty string. 2010-11-05 09:34:52 +00:00
Daniele Varrazzo
9c58c01e0f Added comparison between Notify objects and Notify or tuple.
Explicit comparison with the tuple is required if we want to make
Notify() == (pid, channel) work: item access is not enough (and a test
in the suite fails if we get this wrong).
2010-11-05 09:34:52 +00:00
Daniele Varrazzo
6cb949d371 Try to install the hstore type in the test database. 2010-11-05 09:34:52 +00:00
Daniele Varrazzo
1b100b5cbf Skip tests if the hstore type is not in the test database. 2010-11-05 09:34:52 +00:00
Daniele Varrazzo
01ec120aa8 Hstore documentation improved. 2010-11-05 09:34:52 +00:00
Daniele Varrazzo
4b98e8941f Added some documentation for the hstore adaptation. 2010-11-05 09:34:52 +00:00
Daniele Varrazzo
d5bf400cb4 The hstore typecast can be registered globally. 2010-11-05 09:34:52 +00:00
Daniele Varrazzo
bb41acd1da Favour the PG9 implementation of the hstore adapter. 2010-11-05 09:34:51 +00:00
Daniele Varrazzo
ed623776f3 Hstore can return unicode keys and values. 2010-11-05 09:34:51 +00:00
Daniele Varrazzo
00e005b77d Added test to verify dict roundtrip with hstore. 2010-11-05 09:34:50 +00:00
Daniele Varrazzo
af835f8857 Correctly parse escaped quotes from hstore.
Parse regexp simplified.
2010-11-05 09:34:50 +00:00
Daniele Varrazzo
70880dde79 Added special cases to store empty dicts. 2010-11-05 09:34:50 +00:00
Daniele Varrazzo
6d441b6e03 Added hstore typecaster registration. 2010-11-05 09:34:50 +00:00
Daniele Varrazzo
fef9727cce parse_hstore converted in class method. 2010-11-05 09:34:50 +00:00
Daniele Varrazzo
5844e989c4 Added function to parse an hstore into a dict. 2010-11-05 09:34:50 +00:00
Daniele Varrazzo
5693c9cab1 Added implementation of python dict adapter to hstore. 2010-11-05 09:34:50 +00:00
Daniele Varrazzo
90e0e2f47d Added documentation for the Xid object. 2010-11-05 09:34:50 +00:00
Daniele Varrazzo
3e658c33b5 Ensure unicode is accepted as type for transaction ids.
We don't do somersaults to ensure people can use snowmen as transaction
ids anyway: it would require passing the connection to xid_ensure and
down below to use the correct encoding.
2010-11-05 09:34:50 +00:00
Daniele Varrazzo
4f3976681a Added Xid.from_string() constructor.
It exposes the parsing rules used in restore.
2010-11-05 09:34:49 +00:00
Daniele Varrazzo
2f29429e88 Expose the Xid object in the extension module. 2010-11-05 09:34:49 +00:00
Daniele Varrazzo
f0f5f095c7 Fixed handling of commit/rollback prepared in green mode 2010-11-05 09:34:49 +00:00
Daniele Varrazzo
a923a16ae8 Added two-phase commit docunetation. 2010-11-05 09:34:49 +00:00
Daniele Varrazzo
5dbeeba0f2 Raise NotSuppoertdError if tpc is used with PostgreSQL < 8.1 2010-11-05 09:34:49 +00:00
Daniele Varrazzo
ab8e145063 Encoding/decoding in base64 refactored. 2010-11-05 09:34:49 +00:00
Daniele Varrazzo
3312897e5d Added str() and repr() for Xid objects. 2010-11-05 09:34:49 +00:00
Daniele Varrazzo
4fdcfe365c xid_get_tid returns a Python string, not a buffer. 2010-11-05 09:34:49 +00:00
Daniele Varrazzo
774be1d616 Dropped XID_UNPARSED: we use format_id = None for PG xact ids. 2010-11-05 09:34:49 +00:00
Daniele Varrazzo
978cac3a1b XA transaction ids can be decoded from PostgreSQL transaction ids. 2010-11-05 09:34:48 +00:00
Daniele Varrazzo
6309e038e5 Dropped pg_xact_id from XidObject 2010-11-05 09:34:48 +00:00
Daniele Varrazzo
c0c116dcc4 Use pgjdbc algorithm to convert XA xids into strings. 2010-11-05 09:34:48 +00:00
Daniele Varrazzo
17d70babb1 Keep the GIL while converting the xid into the PostgreSQL transaction id. 2010-11-05 09:34:48 +00:00
Daniele Varrazzo
397eace051 Added tests for two-phase commit/rollback. 2010-11-05 09:34:48 +00:00
Daniele Varrazzo
56c02b0f94 Added tpc_recover method. 2010-11-05 09:34:48 +00:00
Daniele Varrazzo
09983db6ed Added tpc_commit and tpc_rollback methods. 2010-11-05 09:34:48 +00:00
Daniele Varrazzo
4f66de494b Added tpc_prepare and CONN_STATUS_PREPARED. 2010-11-05 09:34:48 +00:00
Daniele Varrazzo
4588fa50f2 begin and commit can't be called during a two-phase transaction. 2010-11-05 09:34:48 +00:00
Daniele Varrazzo
98c5b1d374 Added tpc_begin() and current xid on connection. 2010-11-05 09:34:48 +00:00
Daniele Varrazzo
60ee39fa3d Copyright of TPC files moved to LGPL V3.
With the permission of James Henstridge.
2010-11-05 09:34:47 +00:00
Daniele Varrazzo
8bfd34faf2 hook up two phase commit tests.
By James Henstridge on 2008-07-24.

Merged from lp:~jamesh/psycopg/two-phase-commit/revision/359
2010-11-05 09:34:47 +00:00
Daniele Varrazzo
7a9d678050 There is no point in allowing subclasses of Xid.
By James Henstridge on 2008-07-24.

Merged from lp:~jamesh/psycopg/two-phase-commit/revision/358
2010-11-05 09:34:47 +00:00
Daniele Varrazzo
22aea9114b implement sequence behaviour, as required for transaction IDs.
By James Henstridge on 2008-07-24.

Merged from lp:~jamesh/psycopg/two-phase-commit/revision/357
2010-11-05 09:34:47 +00:00
Daniele Varrazzo
0021e56d80 Added connection.xid() and related objects.
By James Henstridge on 2008-07-23.

Merged from lp:~jamesh/psycopg/two-phase-commit/revision/356

* psycopg/connection_type.c (psyco_conn_xid): add a
Connection.xid() method that instantiates Xid objects.

* psycopg/psycopgmodule.c (init_psycopg): initialise the Xid
object type.

* psycopg/xid.h:
* psycopg/xid_type.c: Implement a basic transaction ID object for
use in two phase commit.
2010-11-05 09:34:47 +00:00
Daniele Varrazzo
e863222b5c beginnings of a TPC test harness
By James Henstridge on 2008-05-12.

Merged from lp:~jamesh/psycopg/two-phase-commit/revision/354
2010-11-05 09:34:47 +00:00
Daniele Varrazzo
1a0fca09d9 Added documentation for the Notify object. 2010-11-05 09:34:47 +00:00
Daniele Varrazzo
4ec298e112 Notify object exposed in the extensions module. 2010-11-05 09:34:47 +00:00
Daniele Varrazzo
8db9c7085d Added repr method for Notify object. 2010-11-05 09:34:47 +00:00
Daniele Varrazzo
f435d15c95 Adding Notify object with payload. 2010-11-05 09:34:46 +00:00
Daniele Varrazzo
e651308287 Check the correctness of the PID in the notify tests. 2010-11-05 09:34:46 +00:00