Commit Graph

404 Commits

Author SHA1 Message Date
Daniele Varrazzo
3e94375cf7 Merge branch 'python2' into python3
Conflicts:
	ChangeLog
	NEWS-2.3
	lib/extensions.py
	psycopg/microprotocols.c
	setup.py
2011-01-01 17:14:54 +01:00
Daniele Varrazzo
e182201e6e Added Python codec name to the connection.
This allows dropping repeated dictionary lookups with unicode
query/parameters.
2010-12-21 04:02:14 +00:00
Daniele Varrazzo
ae06fb03e7 Added psycopg_strdup utility function. 2010-12-21 04:02:14 +00:00
Daniele Varrazzo
a50a91fc7b No need to put connection fields to zero: tp_alloc already did. 2010-12-21 04:02:14 +00:00
Daniele Varrazzo
7b5d80d36d Added a few missing encodings.
EUC_CN, EUC_JIS_2004, ISO885910, ISO885916, LATIN10, SHIFT_JIS_2004.
2010-12-21 04:02:14 +00:00
Daniele Varrazzo
b96dcef8a2 Fixed PG -> Py encodings mapping with non-alnum chars.
We mangle the encoding names a little bit before asking it to the
backend: be sure to be able to find the equivalent Python code back or
decoding (unicode cast or Py3) will barf.
2010-12-21 04:02:14 +00:00
Daniele Varrazzo
ddd2de0410 Updated ChangeLog/NEWS after ticket #24 patch commit. 2010-12-18 15:38:56 +00:00
Daniele Varrazzo
557e28d744 Dropped interface for two private functions.
Note: the functions are private because typecast.c imports the .c's of
typecast_[mx]datetime, not the .h's.

Work around the warning for 'skip_until_space' not used with an #ifdef.
Furthermore, those functions are now static.
2010-12-04 13:51:21 +00:00
Daniele Varrazzo
288f9ee809 Work around CentOS 5.5 x86_64 buld problem.
Closes ticket #23
2010-12-04 13:51:21 +00:00
Daniele Varrazzo
ebd73c14a8 Going to dev version for 2.3.1. 2010-12-04 13:43:28 +00:00
Daniele Varrazzo
0ad7483a2b DictRow items can be updated. Patch by Alex Aster. 2010-12-01 13:17:12 +00:00
Daniele Varrazzo
0c7b0a943b A prepared connection can't be canceled. 2010-11-28 12:15:26 +00:00
Daniele Varrazzo
4dbd4344a3 Mention query cancelling in the release notes. 2010-11-28 12:14:04 +00:00
Daniele Varrazzo
fdf1ba1aac Dropped notices hack to get COPY errors from V2 protocol. 2010-11-22 00:49:07 +00:00
Daniele Varrazzo
163cf5bfb4 mx.DateTime module initialized as it is supposed to be.
No need to pass the api pointer around. Dropped compiler warnings.
2010-11-19 00:28:49 +00:00
Daniele Varrazzo
3e3aa676a9 datetime module initialized as it is supposed to be.
Dropped compiler warnings. It wouldn't blow up if any api was called.
No need to pass type pointers around.
2010-11-19 00:28:39 +00:00
Daniele Varrazzo
576b01f6a3 Functions exported to drop warnings. 2010-11-19 00:20:49 +00:00
Daniele Varrazzo
67793ed989 Compiler warning dropped. 2010-11-18 23:13:16 +00:00
Daniele Varrazzo
bcacdc8461 Added enum with possilbe isolation level states.
Also, general isolation levels cleanup and tests added.
2010-11-18 00:31:51 +00:00
Daniele Varrazzo
c3c54aab38 Don't clobber exception if conn_switch_isolation_level fails.
Which shouldn't.
2010-11-17 01:43:50 +00:00
Daniele Varrazzo
e1a04bec0e Don't inconditionately run a query at connection to set datestyle to ISO.
Run it only if PQparameterStatus() reports the datestyle is set to
something different.
2010-11-16 18:15:00 +00:00
Daniele Varrazzo
15bba2966f Don't run a query at connection to detect client encoding.
Use PQparameterStatus() instead. This is only guaranteed in protocol 3.
2010-11-16 10:16:52 +00:00
Daniele Varrazzo
a88d7ab424 Dropped support for protocol 2.
Dropped both the setup constant allowing conditional compiling and the
code specific to V2 protocol (mostly COPY and error handling).
2010-11-16 01:08:50 +00:00
Daniele Varrazzo
73265e7ece Refuse connection with server with protocol version 2.
This cuts off server whose version is older than 7.4. But enables us to
remove large portions of code rarely used and tested (e.g. p2 copy) and
will allow us to drop the query we do at each connection to establish
the client encoding and the datestyle.
2010-11-16 01:01:32 +00:00
Daniele Varrazzo
cd19f9115d Fixed notices order (ticket #9). 2010-11-11 11:54:43 +00:00
Daniele Varrazzo
3cae0f3f5d NamedTupleCursor doesn't change exception when fetching with no result. 2010-11-11 10:39:42 +00:00
Daniele Varrazzo
ef7a5ee8a9 Build the namedtuple only once per execution, not once per fetch. 2010-11-11 10:39:42 +00:00
Daniele Varrazzo
92ee893f0f Functions unused outside the module marked static. 2010-11-10 15:50:05 +00:00
Daniele Varrazzo
a39e98f9e5 Check the presence of a mro.
The mere presence of the Py_TPFLAGS_HAVE_CLASS doesn't ensure it is
there.
2010-11-09 14:28:00 +00:00
Daniele Varrazzo
f0773d5682 Avoid pointless string manipulation in NamedTupleCursor.
Closes ticket #10. Reported by Marko Kreen.
2010-11-09 11:17:02 +00:00
Daniele Varrazzo
ed6a4c8b1a Dropped PyArg_ParseTuple() calls in functions taking no arguments. 2010-11-09 03:18:54 +00:00
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