Commit Graph

373 Commits

Author SHA1 Message Date
Daniele Varrazzo
753b580d72 Less lookups and more efficient calls in microprotocols_getquoted(). 2010-11-09 02:21:21 +00:00
Daniele Varrazzo
422fede38e Replaced PyObject_CallFunction() with *ObjArgs() where more efficient. 2010-11-09 01:49:22 +00:00
Daniele Varrazzo
d601ab8239 fixed crash in pdecimal_str with a few Python 2.5.x releases.
is_finite() is not available in 2.5.1, it is in 2.5.5 but is officially
supported only since 2.6.
2010-11-09 00:14:22 +00:00
Daniele Varrazzo
62d3a1533b Use the adapter of an object superclass if available. 2010-11-08 01:35:06 +00:00
Daniele Varrazzo
225b276de5 Use faster function to build tuples in adaptation.
Fixed a refcount bug too.
2010-11-08 01:28:01 +00:00
Daniele Varrazzo
abad3127ca Added NamedTupleCursor. 2010-11-06 04:33:44 +00:00
Daniele Varrazzo
274ff8bb1d Dropped reference to removed TODO file: it breaks 'pip'. 2010-11-05 09:40:02 +00:00
Daniele Varrazzo
d6cdc1c7b6 Bump to 2.3.dev0 2010-11-05 09:34:53 +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
7e482756c5 Use PQfreemem to free memory allocated by the libpq.
Bug reported by Anton Kovalev.
2010-10-08 14:26:40 +01:00
Daniele Varrazzo
6e71b3db05 Dropped PSYCOPG_OWN_QUOTING.
It was deprecated for version 2.1. There are bugs to be fixed made more
complex by its presence and it doesn't keep into account PostgreSQL 9.0
new binary format.

Time to go!
2010-10-08 12:27:47 +01:00
Daniele Varrazzo
baf65a0dda Fixed access to freed memory in conn_get_isolation_level().
Bug reported by Anton Kovalev.
2010-10-08 12:02:53 +01:00
Daniele Varrazzo
bc2aefeacf cursor.mogrify() accepts unicode queries. 2010-10-05 03:13:44 +01:00
Daniele Varrazzo
5b4d366f4e Common code in execute() and mogrify() merged. 2010-10-05 01:43:23 +01:00
Daniele Varrazzo
75a6f783c5 Added PostgreSQL 9.0 error codes. 2010-09-23 23:43:23 +01:00
Daniele Varrazzo
2081ceffde Don't execute a ROLLBACK on close()/GC.
The command wasn't sent since 2.2.0 due to a bug, but after a ML
discussion this behaviour proved more correct so the bug has become a
feature.
2010-09-23 23:28:30 +01:00
Federico Di Gregorio
c3b835929b Preparing release 2.2.2 2010-07-18 12:32:45 +02:00
Daniele Varrazzo
deb2d9050f Exceptions raised by the columns iterator propagated. 2010-07-10 00:12:50 +01:00
Daniele Varrazzo
927f2bb1f1 Dropped logging.basicConfig() call.
It messes up with projects using logging but where no handler is
installed on the root logger.  Bug reported by Joe Abbate.
2010-07-09 23:23:10 +01:00
Daniele Varrazzo
3773b50bb3 Propagate iterable exceptions to the executemany caller. 2010-07-09 23:22:35 +01:00
Daniele Varrazzo
4a78e4068b Dropped register_tstz_w_secs() implementation.
The function is no-op now that the default type caster can deal with
seconds in the tz offset.
2010-05-20 02:18:04 +01:00
Daniele Varrazzo
305d86f38a Handle time zones with seconds in the UTC offset.
The offset is rounded to the nearest minute.
2010-05-20 02:16:04 +01:00
Federico Di Gregorio
23391a3c55 Preparing release 2.2.1 2010-05-17 21:51:25 +02:00
Federico Di Gregorio
e286970b62 Preparing release 2.2.0 2010-05-16 12:55:59 +02:00
Federico Di Gregorio
6521fb5a44 Fixed error related to calling C typecasters from Python ones 2010-05-15 19:34:56 +02:00
Daniele Varrazzo
c46a1dad63 Fixed TimeFromTicks for second values > 59.5. 2010-05-15 14:27:24 +01:00
Daniele Varrazzo
afea19651c Fixed TimestampFromTicks for second values > 59.5.
Bug reported and fixed by Jozsef Szalay on 2010-05-06 at 14:11:59.999920.
2010-05-15 14:27:24 +01:00
Daniele Varrazzo
bf1c76b792 Explicit cast of the SQL representation of time-related objects.
Allow the objects to be recognized as the proper type by Postgres in not
strong contexts: problem reported by Peter Eisentraut.

Added tests to check the types are respected in a complete Py -> PG ->
Py roundtrip without context.
2010-05-15 14:27:23 +01:00
Daniele Varrazzo
e8c2a14362 Added typecasters for arrays of specific MX/Py time-related types. 2010-05-15 14:27:23 +01:00
Daniele Varrazzo
c8aef26e15 Adapt buffer objects using an explicit cast on the string literal.
Don't rely on Postgres casting the literal according to the context:
this doesn't work e.g. passing the object as function argument where a
function with the same name but taking a text exists. It doesn't work
either when the object is in an ARRAY construct.

Added test to check the type is respected in a complete Py -> PG -> Py
roundtrip without context.

Bug and solution reported by Peter Eisentraut.
2010-05-15 14:27:23 +01:00
Daniele Varrazzo
02a28ff028 Notifications are automatically read after each query.
Added tests for basic notifications process.
2010-04-21 15:09:14 +01:00
Daniele Varrazzo
bcfcea4b49 Fixed reference leak in notify reception. 2010-04-21 15:09:13 +01:00
Daniele Varrazzo
2af29b467d Added missing points to the changelog. 2010-04-21 15:09:13 +01:00
Daniele Varrazzo
d162c08cfa PY* and MX* typecasters imported into the extensions module. 2010-04-14 00:27:28 +01:00
Daniele Varrazzo
54e9c89ea4 DECIMAL typecaster imported into the extensions module. 2010-04-14 00:20:16 +01:00
Federico Di Gregorio
c1a24f4ca2 NOTIFYs fix and poll status changes
POLL_OK has been changed from 3 to 0 to let the user specify a short loop
just as "if not curs.poll()" instead of having to check for write and read
separately. For an example of this, see examples/notify.py.
2010-04-05 16:52:25 +02:00
Federico Di Gregorio
0edd520593 Preparing release 2.0.14 (final) 2010-03-13 21:15:50 +01:00
Federico Di Gregorio
21a6a64fd1 Changed setup.py to detect PostgreSQL "alpha" versions 2010-03-11 22:42:00 +01:00
Federico Di Gregorio
855674faf1 Fixed Python 2.4 segfault related to decimal implementation 2010-02-28 20:52:03 +01:00
Federico Di Gregorio
192034dc38 Fixed problem with decimal.Decimal conversions 2010-02-21 01:04:00 +01:00
Daniele Varrazzo
d08d9ab199 Added errorcodes.lookup() function. 2010-02-15 01:38:49 +00:00
Daniele Varrazzo
04db8e7428 Fixed docstring for 'QueryCanceledError' exception. 2010-02-14 00:35:48 +01:00
Daniele Varrazzo
e1b3c7b940 Fixed Inet constructor. 2010-02-14 00:35:48 +01:00
Daniele Varrazzo
0dbe068df4 Stop the loop variable used to create __all__ leaking in the module. 2010-02-14 00:35:47 +01:00
Federico Di Gregorio
0089201ba2 Binary was not imported from _psycopg; now it is 2010-02-13 00:52:36 +01:00
Federico Di Gregorio
a9673f31d6 SQL_IN adapter is now automatically registered 2010-02-13 00:40:29 +01:00