1
2009-04-21 Federico Di Gregorio <fog@initd.org>
3
* setup.py: applied patch from Elvis Pranskevichus to make
4
PostgreSQL version detection more robust.
6
2009-04-20 Federico Di Gregorio <fog@initd.org>
10
* psycopg/cursor_type.c: patch from Gangadharan to avoid double
11
free of the cursor when the connection that creates it is closed
12
implicitly by dealloc.
14
2009-04-19 Federico Di Gregorio <fog@initd.org>
16
* psycopg/connection_type.c: patch from Gangadharan to avoid double
17
free of the connection object when calling close() implicitly.
19
* psycopg/connection_type.c: patch from Marko Kreen to implement
20
get_parameter_status().
22
* psycopg/connection.*: exposed protocol_version and
23
server_version attributes on the connection object.
25
* lib/extras.py: patch from Marko Kreen to implement missing dict
28
2009-04-04 Federico Di Gregorio <fog@initd.org>
30
* connection_int.c(conn_notice_callback): removed all Python
31
calls because conn_notice_callback() can be called without a lock
32
on the GIL. Moved processing and cleanup of notices into their
33
own functions that are called while holding the GIL.
35
2009-04-01 Federico Di Gregorio <fog@initd.org>
37
* Applied patch from Menno Smits to fix failures in test_dates
38
when executed in older version of Python.
40
* Applied patch from Menno Smits to fix lobject test failures.
42
2009-03-08 Federico Di Gregorio <fog@initd.org>
44
* microprotocols.c: None is always adapted to NULL to avoid
45
errors when calling adapt on nested types without first checking
48
2009-03-02 Federico Di Gregorio <fog@initd.org>
50
* Applied modified patch from Karsten Hilbert to provide a
51
type-caster able to parse times with seconds in the time zone.
53
* Applied patch from Menno Smits to avoid problems with DictCursor
54
when the query is executed by a named cursor. Also added Menno's
55
tests and uniformed other DictCursor tests.
57
* psycopg/psycopgmodule.c: fixed unwanted exception when passing an
58
explicit None to register_type().
60
* psycopg/config.h: applied patch from Jason Erickson to build
61
with MSVC. Solaris version of isinf() is now a macro.
63
2009-02-27 Federico Di Gregorio <fog@initd.org>
65
* psycopg/config.h: added check to provide compatible isinf()
66
for Solaris (thanks to Jeremy Mason.)
68
2009-02-23 Federico Di Gregorio <fog@initd.org>
72
2009-02-17 James Henstridge <james@jamesh.id.au>
74
* psycopg/utils.c (psycopg_escape_string): same here.
76
* psycopg/adapter_binary.c (binary_escape): simplify PostgreSQL
79
* setup.py (psycopg_build_ext.finalize_options): use a single
80
define of the PostgreSQL version in a form that can easily be used
83
* tests/test_dates.py (DatetimeTests, mxDateTimeTests): full test
84
coverage for datetime and time strings with and without time zone
87
* psycopg/typecast_datetime.c (typecast_PYDATETIME_cast): adjust
88
to handle the changes in typecast_parse_time.
89
(typecast_PYTIME_cast): add support for time zone aware time
92
* psycopg/typecast_mxdatetime.c (typecast_MXDATE_cast): make sure
93
that values with time zones are correctly processed (even though
94
that means ignoring the time zone value).
95
(typecast_MXTIME_cast): same here.
97
* psycopg/typecast.c (typecast_parse_time): Update method to parse
98
second resolution timezone offsets.
100
* psycopg/typecast.c (typecast_parse_time): Fix up handling of
101
negative timezone offsets with a non-zero minutes field.
103
* tests/test_dates.py (DatetimeTests): Add tests for time zone
104
parsing. The test for HH:MM:SS time zones is disabled because we
105
don't currently support it.
107
2009-02-16 Federico Di Gregorio <fog@initd.org>
109
* FreeBSD now has round(). Modified config.h as suggested by
110
Jeroen Ruigrok van der Werven.
112
2009-02-06 Federico Di Gregorio <fog@initd.org>
114
* Applied patch by Markus Demleitner to make executemany() return
115
the sum of modified rows by executed statements or -1 if any one
116
statement returns it. This is still DBAPI-2.0 compliant.
118
2009-01-23 Federico Di Gregorio <fog@initd.org>
120
* Fixed problem mailed by Markus Demleitner about Python to
121
PostgreSQL conversions of "nan" and "inf" floats resulting in
122
backend errors. Added the new psycopg2.extensions.Float adapter
123
that correctly handle both values and unit tests. (The opposite
124
conversion was already working.)
126
2009-01-20 Federico Di Gregorio <fog@initd.org>
128
* Fixed problem reported by Lawrence Oluyede where
129
register_type() didn't work on connection and cursors
132
2009-01-10 Federico Di Gregorio <fog@initd.org>
134
* psycopg/cursor_type.c: cursor.isready() now raise an exception
135
when the libpq PQconsumeInput() call fails.
137
2008-12-04 Federico Di Gregorio <fog@initd.org>
139
* psycopg/lobject_type.c: fixed memory leak. The patch was kindly
140
sent from a psycopg user but I wrongly deleted the email so no
141
kudos (and I had to fix the problem by myself!)
143
2008-11-25 Federico Di Gregorio <fog@initd.org>
145
* psycopg/cursor_type.c: integrated patch from Alejandro Dubrovsky.
146
Note that the statically allocated buffer should probably go away
147
in favor of always allocating the buffer dinamically.
149
* psycopg/utils.c: modified patch from Alejandro Dubrovsky to
150
support quoted separators in COPY queries: now all the string
151
quoting code is in utils.c and the same function is used by
152
qstrings and everything else (like the COPY code.)
154
2008-09-24 Federico Di Gregorio <fog@initd.org>
156
* lib/extras.py: added inet support and related tests.
158
2008-09-23 James Henstridge <james@jamesh.id.au>
160
* psycopg/psycopg.h (NotSupportedError_doc): clean up
161
spelling/grammar a bit, using exception description from the PEP.
163
2008-09-23 Federico Di Gregorio <fog@initd.org>
165
* Applied patch from Brian Sutherland that fixes NULL
166
valus in UUID support.
168
2008-09-19 Federico Di Gregorio <fog@initd.org>
170
* lib/extras.py: added UUID support, modeled after the code
171
sent by Brian Sutherland.
173
2008-09-16 Federico Di Gregorio <fog@initd.org>
177
2008-07-26 Federico Di Gregorio <fog@initd.org>
179
* psycopg/connection_type.c: merged get_backend_pid() method
182
2008-07-23 James Henstridge <james@jamesh.id.au>
184
* psycopg/lobject_type.c (lobject_setup): use
185
FORMAT_CODE_PY_SSIZE_T in Dprintf() call for 64-bit compatibility
186
when using Python 2.5 or later.
187
(lobject_dealloc): same here.
189
2008-07-18 James Henstridge <james@jamesh.id.au>
191
* psycopg/adapter_qstring.c (qstring_traverse): add cyclic GC
192
traversal for quoted string adapters.
194
* psycopg/adapter_pboolean.c (pboolean_traverse): add cyclic GC
195
traversal for boolean adapters.
197
* psycopg/adapter_mxdatetime.c (mxdatetime_traverse): add cyclic
198
GC traversal for mxdatetime adapters.
200
* psycopg/adapter_datetime.c (pydatetime_traverse): add cyclic GC
201
traversal for datetime adapters.
203
2008-07-01 James Henstridge <james@jamesh.id.au>
205
* psycopg/adapter_binary.c (binary_traverse): add cyclic GC
206
traversal for binary adapters.
208
* psycopg/adapter_asis.c (asis_traverse): add cyclic GC traversal
211
* psycopg/adapter_list.c (list_traverse): add cyclic GC traversal
214
2008-05-28 James Henstridge <james@jamesh.id.au>
216
* psycopg/cursor_type.c (cursor_setup): incref before setting
217
attributes, to make things GC-safe.
219
* psycopg/cursor_int.c (curs_reset): make clearing of description
220
and casts attributes GC-safe.
222
* psycopg/typecast.c (typecast_traverse): implement cyclic GC
223
traversal for typecasters.
225
* psycopg/connection_type.c:
226
* psycopg/cursor_type.c: add support for cyclic GC traversal (no
227
support for clearing).
229
* psycopg/python.h: add definitions for Py_CLEAR() and Py_VISIT()
230
for compatibility with old versions of Python.
232
2008-06-28 Federico Di Gregorio <fog@initd.org>
234
* setup.py: fixed problem with spaces in pg_config path.
236
2008-05-27 Federico Di Gregorio <fog@initd.org>
238
* psycopg/pqpath.c: better error checks in _pq_copy_in_v3 to
239
avoid calling blocking libpq functions when the connection to
240
the server has been broken
242
2008-05-19 Federico Di Gregorio <fog@initd.org>
244
* psycopg/cursor_type.c: fixed memory leak in .executemany(); on
245
error "iter" was not dec'reffed.
247
2008-05-06 James Henstridge <james@jamesh.id.au>
249
* psycopg/lobject.h (lobjectObject): remove "mode" struct member,
252
* psycopg/lobject_*.c: replace uses of the closed struct member,
253
and change the Python level attribute to a getset.
255
* psycopg/lobject.h (lobjectObject): remove the closed member,
256
since "fd < 0" gives us the same information. Reorder the struct
257
members for better packing.
259
* psycopg/lobject*: const'ify the code.
261
* tests/test_lobject.py (LargeObjectTests): add more tests,
262
including behaviour on closed lobjects and stale lobjects.
264
* psycopg/lobject_type.c (psyco_lobj_close): don't mark the
265
connection closed here because it is done by
266
lobject_close_locked().
268
* psycopg/lobject_int.c (lobject_open): mark objects as not closed
269
if we successfully open them.
270
(lobject_close_locked): mark the lobject closed here.
271
(lobject_export): ensure we are in a transaction, since
272
lo_export() issues multiple queries.
274
* psycopg/lobject_type.c (lobject_setup): make lobjects start closed.
276
2008-05-05 James Henstridge <james@jamesh.id.au>
278
* psycopg/lobject.h: don't export the lobjectType symbol.
280
2008-05-05 Federico Di Gregorio <fog@initd.org>
282
* Fixed sun build problem by adding "sun" to config.h checks.
284
2008-05-05 James Henstridge <james@jamesh.id.au>
286
* psycopg/pqpath.c (pq_complete_error): get rid of double free
287
error in case when pgres is NULL.
289
* tests/test_lobject.py: add some basic tests for large object
292
* psycopg/lobject*.[ch]: port the large object code to work with
293
current psycopg code.
295
2006-09-01 Federico Di Gregorio <fog@initd.org>
297
* psycopg/connection_type.c: merged in double mutex destroy patch
298
from Joerg Sonnenberger.
300
* Implemented large objects support.
302
* psycopg/connection_int.c: removed increment of self->mark,
303
now it is done directly in pqpath.c to make sure even the
304
large object support gets it.
306
* Starting 2.1 development.
308
2008-04-21 James Henstridge <james@jamesh.id.au>
310
* tests/test_quote.py (QuotingTestCase.test_unicode): If the
311
server encoding is not UTF8, skip the unicode test and emit a
314
2008-04-21 Jorgen Austvik <Jorgen.Austvik@sun.com>
316
* tests/*.py: use the DSN constructed in tests/__init__.py.
318
* tests/__init__.py: allow setting the host, port and user for the
319
DSN used by the tests through the environment.
321
2008-03-17 Federico Di Gregorio <fog@initd.org>
325
2008-03-31 James Henstridge <james@jamesh.id.au>
327
* psycopg/connection_type.c (connection_dealloc): free
328
connection->encoding with free() instead of PyMem_Free().
330
* psycopg/connection_int.c (conn_connect): use malloc() to
331
allocate connection->encoding instead of PyMem_Malloc(), since it
332
is freed in other places with free() and assigned to with
335
2008-03-26 James Henstridge <james@jamesh.id.au>
337
* psycopg/typecast.c (typecast_from_c): fix up some reference
338
leaks. This leak affected a bounded set of objects, so doesn't
339
account for any gradual leaks.
341
2008-03-19 James Henstridge <james@jamesh.id.au>
343
* psycopg/connection_int.c (conn_notice_callback): don't leak
346
2008-03-17 Federico Di Gregorio <fog@initd.org>
348
* psycopg/adapter_datetime.c: fixed double decref when using
349
a PyObject as a parameter in a nested call (line 415).
351
2008-03-17 James Henstridge <james@jamesh.id.au>
353
* psycopg/typecast.c (typecast_parse_time): give the correct
354
return value for partially parsed time values.
356
* psycopg/typecast_mxdatetime.c (typecast_MXDATE_cast): return
357
NULL after setting DataError. Also, don't treat it as an error if
358
typecast_parse_time() returns 0 (as might happen if the remainder
359
of the string is " BC").
361
* psycopg/typecast_datetime.c (typecast_PYDATE_cast): return NULL
362
after setting DataError.
363
(typecast_PYDATETIME_cast): same here.
364
(typecast_PYTIME_cast): same here.
366
* tests/test_dates.py
367
(CommonDatetimeTestsMixin.test_parse_incomplete_date): test that
368
parsing incomplete date values results in DataError.
369
(CommonDatetimeTestsMixin.test_parse_incomplete_time): same for
371
(CommonDatetimeTestsMixin.test_parse_incomplete_time): same for
374
2008-03-07 Jason Erickson <jerickso@stickpeople.com>
376
* psycopg/pqpath.c (pq_raise): if PSYCOPG_EXTENSIONS is not
377
defined, raise OperationalError rather than
378
TransactionRollbackError for deadlock or serialisation errors for
379
protocol versions less than 3.
381
* psycopg/psycopgmodule.c (psyco_connect): fix off by one error in
382
calculating the length of the DSN.
384
2008-03-07 James Henstridge <james@jamesh.id.au>
386
* psycopg/pqpath.c (_pq_fetch_tuples): Don't call Python APIs
387
without holding the GIL.
389
2008-02-27 James Henstridge <james@jamesh.id.au>
391
* NEWS: add some draft NEWS items for a 2.0.7 release.
393
* runtests.py: add a harness to run all the psycopg tests against
394
the version built by distutils.
396
2008-01-22 James Henstridge <james@jamesh.id.au>
398
* psycopg/typecast.c (typecast_pydatetime): make array static.
399
(typecast_mxdatetime): same here.
401
* psycopg/typecast_builtins.c (typecast_builtins): make array
404
* psycopg/psycopgmodule.c: add hidden visibility to a bunch of
405
global variables here.
407
* psycopg/psycopg.h: add set QueryCanceledError and
408
TransactionRollbackError to hidden visibility.
410
* psycopg/*.[ch]: add const qualifier to various string arguments
411
to functions (typecast functions and conn_switch_isolation_level).
413
2008-01-21 James Henstridge <james@jamesh.id.au>
415
* setup.cfg (define): remove PSYCOPG_DISPLAY_SIZE from default
416
list of defines, as discussed on mailing list. It slows down
417
queries with very little benefit.
419
* psycypg/*.h: apply HIDDEN to all global variables and functions
420
that should not be exported from the module. This results in a 5%
421
reduction in code size and shortens the dynamic symbol table.
423
* psycopg/config.h: If GCC >= 4.0 is installed, define the HIDDEN
424
symbol to apply the "hidden" visibility attribute.
426
2008-01-19 James Henstridge <james@jamesh.id.au>
428
* tests/test_connection.py (ConnectionTests): add simple tests for
429
the Connection and Cursor "closed" attributes.
431
* psycopg/cursor_type.c (psyco_curs_get_closed): add a "closed"
432
attribute to cursors. It will be True if either the cursor or its
433
associated connection are closed. This fixes bug #164.
435
* psycopg/pqpath.c (pq_raise): remove unused arguments to
436
function, and simplify.
437
(pq_resolve_critical): make function static, since it isn't being
438
used outside of pqpath.c any more.
440
2008-01-17 James Henstridge <james@jamesh.id.au>
442
* ZPsycopgDA/DA.py (Connection.__init__): Default the encoding to
443
UTF-8, fixing bug #190.
444
(App.ImageFile): simplify ImageFile import using patch from
445
chrism, fixing bug #198.
447
2008-01-16 James Henstridge <james@jamesh.id.au>
449
* tests/test_transaction.py (DeadlockSerializationTestCase): port
450
over some tests for serialisation and deadlock errors,
451
demonstrating that TransactionRollbackError is generated.
452
(QueryCancelationTests): add a test to show that
453
QueryCanceledError is raised on statement timeouts.
455
* psycopg2da/adapter.py (_handle_psycopg_exception): rather than
456
checking exception messages, check for TransactionRollbackError.
458
* psycopg/pqpath.c (exception_from_sqlstate): return
459
TransactionRollbackError for 40xxx errors, and QueryCanceledError
461
(pq_raise): If we are using an old server, use
462
TransactionRollbackError if the error message contains "could not
463
serialize" or "deadlock detected".
465
* psycopg/psycopgmodule.c (_psyco_connect_fill_exc): remove
466
function, since we no longer need to store pointers to the
467
exceptions in the connection. This also fixes a reference leak.
468
(psyco_connect): remove _psyco_connect_fill_exc() function call.
470
* psycopg/connection.h (connectionObject): remove exception
473
* psycopg/connection_type.c (connectionObject_getsets): modify the
474
exception attributes on the connection object from members to
475
getsets. This reduces the size of the struct.
477
* lib/extensions.py: import the two new extensions.
479
* psycopg/psycopgmodule.c (exctable): add new QueryCanceledError
480
and TransactionRollbackError exceptions.
482
2008-01-16 James Henstridge <james@jamesh.id.au>
484
* tests/__init__.py (test_suite): add date tests to test suite.
486
* tests/test_dates.py: add tests for date/time typecasting and
489
* psycopg/adapter_mxdatetime.c (mxdatetime_str): add support for
490
outputting BC dates (which involves switching them to one-based
491
dates). Also remove broken handling of microseconds.
493
* psycopg/typecast.c (typecast_parse_date): if the string ends
494
with "BC" adjust the year value to be a zero-based BC value as
495
used by mx.DateTime (datetime doesn't support BC dates).
496
(typecast_parse_time): ignore ' ', 'B' and 'C' in time strings
497
rather than treating them as part of the seconds part of the time.
499
2008-01-14 James Henstridge <james@jamesh.id.au>
501
* psycopg/typecast_array.c (typecast_array_scan): set an initial
502
value for quotes to keep gcc happy.
504
* psycopg/*.c: add missing static modifier on many functions.
506
2008-01-12 James Henstridge <james@jamesh.id.au>
508
* tests/test_transaction.py
509
(TransactionTestCase.test_failed_commit): Expect IntegrityError
510
instead of OperationalError.
512
* psycopg/pqpath.c (exception_from_sqlstate): new function that
513
converts an SQLSTATE error code to the corresponding exception
515
(pq_raise): use exception_from_sqlstate() to pick which exception
516
to use when working with protocol version 3.
517
(pq_complete_error): Let pq_raise() pick an appropriate exception
518
rather than forcing OperationalError.
520
2008-01-11 James Henstridge <james@jamesh.id.au>
522
* psycopg/adapter_binary.c (binary_quote): apply Brandon Rhodes'
523
patch from ticket #209 to check return value from
524
PyObject_AsCharBuffer(). This fixes the segfault.
525
(binary_quote): switch from PyObject_AsCharBuffer() to
526
PyObject_AsReadBuffer() to support buffer objects that don't
527
implement the bf_getcharbuf protocol.
529
* tests/types_basic.py (TypesBasicTests.testBinary): Test round
530
tripping of bytea buffers. Currently segfaults.
532
* psycopg/connection_int.c (conn_close): fix for new
533
pq_abort_locked() prototype.
534
(conn_switch_isolation_level): fix for new pq_abort_locked()
535
prototype, and use pq_complete_error() to show error message.
536
(conn_set_client_encoding): same here.
538
* psycopg/pqpath.c (pq_execute_command_locked): remove static
540
(pq_complete_error): same here.
541
(pq_abort_locked): add pgres and error arguments.
542
(pq_abort): call pq_abort_locked() to reduce code duplication.
544
2007-12-23 James Henstridge <james@jamesh.id.au>
546
* psycopg/pqpath.c (pq_execute_command_locked): add an error
547
argument to hold an error when no PGresult is returned by PQexec,
548
rather than using pq_set_critical().
549
(pq_complete_error): new function that converts the error returned
550
by pq_execute_command_locked() to a Python exception.
551
(pq_begin_locked): add error argument.
552
(pq_commit): use pq_complete_error().
553
(pq_abort): use pq_complete_error().
554
(pq_abort_locked): always call pq_set_critical() on error, and
555
clear the error message from pq_execute_command_locked().
556
(pq_execute): use pq_complete_error() to handle the error from
559
* psycopg/pqpath.c (pq_begin): remove unused function.
561
* psycopg/connection_type.c (psyco_conn_commit): if conn_commit()
562
raises an error, just return NULL, since it is now setting an
564
(psyco_conn_rollback): same here.
566
* psycopg/connection_int.c (conn_commit): don't drop GIL and lock
567
connection before calling pq_commit().
568
(conn_rollback): same here.
569
(conn_close): use pq_abort_locked().
570
(conn_switch_isolation_level): same here.
571
(conn_set_client_encoding): same here.
573
* psycopg/pqpath.h: add prototype for pq_abort_locked().
575
* psycopg/pqpath.c (pq_commit): convert function to run with GIL
576
held, and handle errors appropriately.
577
(pq_abort): same here.
578
(pq_abort_locked): new function to abort a locked connection.
580
2007-12-22 James Henstridge <james@jamesh.id.au>
582
* psycopg/pqpath.c (pq_raise): add a "pgres" argument so we can
583
generate nice errors not related to a particular cursor.
584
(pq_execute): use pq_begin_locked() rather than pq_begin(). Use
585
pq_raise() to handle any errors from it.
587
* psycopg/pqpath.c (pq_execute_command_locked): helper function
588
used to execute a command-style query on a locked connection.
589
(pq_begin_locked): a variant of pq_begin() that uses
590
pq_execute_command_locked().
591
(pq_begin): rewrite to use pq_begin_locked().
593
2007-12-22 James Henstridge <james@jamesh.id.au>
595
* psycopg/config.h: only print debug messages if
596
psycopg_debug_enabled is true.
598
* psycopg/psycopgmodule.c (init_psycopg): set
599
psycopg_debug_enabled to true if the $PSYCOPG_DEBUG environment
602
2007-12-21 Federico Di Gregorio <fog@initd.org>
604
* Applied win32 patch from Jason Erickson.
606
* Applied patch from Thomas Lotze to use correct version
609
2007-12-20 James Henstridge <james@jamesh.id.au>
611
* psycopg/pqpath.c (pq_execute): uncomment the "curs->pgres ==
612
NULL" error handler after the PQexec() call. This is needed to
613
catch database disconnects (and probably other errors). According
614
to Federico, it was commented out to avoid a spurious error, so we
615
should watch for problems.
617
2007-12-20 James Henstridge <james@jamesh.id.au>
619
* psycopg/pqpath.c (pq_raise): only remove the first 8 characters
620
of the exception message if it actually gives the severity.
622
* psycopg/pqpath.h (pq_resolve_critical): add prototype, since
623
this function is being used from connection_int.c.
625
* psycopg/psycopg.h: update psyco_set_error() prototype.
627
* psycopg/psycopgmodule.c (psyco_errors_init): set pgerror, pgcode
628
and cursor class attributes to None on psycopg2.Error so that the
629
attributes will always be available (simplifies error handling).
630
(psyco_set_error): add const qualifiers to msg, pgerror and pgcode
632
Don't bother setting pgerror, pgcode or cursor to None if they are
633
not provided -- the class defaults take care of this.
635
2007-11-11 Daniele Varrazzo <daniele.varrazzo@gmail.com>
637
* Use escape string syntax for string escape if connected to a
640
2007-11-09 Daniele Varrazzo <daniele.varrazzo@gmail.com>
642
* Use escape string syntax for binary escape if connected to a
645
* Put a limit on the number of notices stored in the connection.
647
2007-10-21 Daniele Varrazzo <daniele.varrazzo@gmail.com>
649
* Fixed bug #192 (Decimal support not safe for use with multiple sub
650
interpreters) as proposed by Graham Dumpleton.
652
2007-09-08 Federico Di Gregorio <fog@initd.org>
654
* Added MonoDevelop project, yahi!
656
2007-09-06 Federico Di Gregorio <fog@initd.org>
660
2007-09-01 Federico Di Gregorio <fog@initd.org>
662
* Added "name" parameter to all .cursor() calls in extras.py.
664
2007-05-29 Federico Di Gregorio <fog@initd.org>
668
* ZPsycopgDA/DA.py: removed call to now obsolete .set_type_casts().
670
* Applied patch from mkz (ticket #187) to add error handling when
671
calling conn_commit() and conn_rollback(). Fixes #187.
673
* cursor.copy_expert() implementation by David Rushby (copy_expert
676
* SQL validation refactor patch from David Rushby (copy_expert
679
* Reference count leak fix from David Rushby (copy_expert set 3/5.)
681
* 64 bit fix patch from David Rushby (copy_expert set 2/5.)
683
* Applied whitespace normalization patch from David Rushby (copy_expert
686
2007-04-25 Federico Di Gregorio <fog@initd.org>
688
* psycopg/connection_type.c: added support for a new method
689
.get_transaction_status() that returns the backend transaction
690
status as libpq knows. Also added some symbolic constants to
691
psycopg.extensions module (TRANSACTION_STATUS_XXX).
693
2007-04-14 Federico Di Gregorio <fog@initd.org>
695
* psycopg/psycopg.h: fixed probable typo in definition of
696
CONV_CODE_PY_SSIZE_T: d -> i for Python < 2.5.
698
* Fixed some of the examples.
700
2007-04-13 Federico Di Gregorio <fog@initd.org>
702
* Applied slighly modified patch from daniel (#176). Made
703
buffer size a compile-time parameter.
705
* Applied patch from David Rushby: typecast_binary.c cleanup.
707
* Applied patch from David Rushby for int->size_t transition.
709
2007-04-12 Federico Di Gregorio <fog@initd.org>
711
* Applied patch from Jason Erickson to fix win32 build glitches.
713
2007-04-11 Federico Di Gregorio <fog@initd.org>
717
* psycopg/cursor_type.c: added check to raise an error when
718
some crazy programmer tries to use different argument formats
719
in the same query string. Fixes #162.
721
* Applied patch from David Rushby to fix win32 builds.
723
2007-04-10 Federico Di Gregorio <fog@initd.org>
725
* Applied patch from David Rushby to fix mem and ref leaks in
728
* Applied super-patch from David Rushby to fix Python 2.5 and 64
729
bit problems (all of them, kudos!)
731
2007-02-22 Federico Di Gregorio <fog@initd.org>
733
* Added support for per-connection and per-cursor typecasters.
735
2007-02-11 Federico Di Gregorio <fog@initd.org>
737
* psycopg/pqpath.c: ported psycopg1 patch from #135.
739
* psycopg/connection_type.c: now the password is obfuscated after we try
740
to connect to the backend. This really fixes #147.
742
2007-01-20 Federico Di Gregorio <fog@initd.org>
746
* Added encodings patch from Karsten Hilbert.
748
2007-01-19 Federico Di Gregorio <fog@initd.org>
750
* psycopg/adapt_list.c: added support for None. And this closes
753
* psycopg/typecast_array.c: added support for detecting the NULL
754
special string and converting it as a real NULL if not enclosed in
755
quotes. This closes half of #154.
757
2007-01-16 Federico Di Gregorio <fog@initd.org>
759
* psycopg/connection_type.c: .set_client_encoding() now converts the
760
argument to upper case to make sure it has the same case of the entries
761
in the PostgreSQL -> Python encoding conversion table.
763
* lib/extras.py: merged DictCursor from #143 and renamed it
764
RealDictCursor because allows access by cursor keys _only_.
765
Also cleaned up a little bit the implementation of both DictCursor
766
and RealDictCursor by introducing DictCursorBase.
768
* psycopg/pqpath.cs: new checks for NULL values (meaning an
769
exception was raised) in all method calls (fixes #134).
771
* psycopg/psycopgmodule.c: applied LATIN patch from #148.
773
* psycopg/connection_type.c: obfuscate password after using it.
775
* lib/extras.py: moved SQL_IN to extensions.py; we're now officially
778
* psycopg/adapt_mxdatetime.c: fixed #137 by accessing the 'date' and
779
'time' attributes of the mx.DateTime instance: they are always in ISO
782
* psycopg/typecast_datetime.c: fixed problem with year > 9999.
784
2006-10-29 Federico Di Gregorio <fog@initd.org>
786
* Applied patch from Jason Erickson to make psycopg build
787
again on win32 (closes: #132).
789
2006-09-30 Federico Di Gregorio <fog@initd.org>
791
* ZpsycopgDA/DA.py: applied the infinity patch from 1.1 (fixes #122).
793
* psycopg/adapter_datetime.py: fixed conversion problem with seconds
794
in the (59,60) range (fixes #131).
796
* ZpsycopgDA/DA.py: we now split on GMT+, GMT-, + or -. This should
799
* psycopg/adapter_datetime.py: now TimeFromTicks and
800
TimestampFromTicks both accept fractionary seconds (fixes #130).
802
2006-09-23 Federico Di Gregorio <fog@initd.org>
804
* lib/errorcodes.py: added list of all PostgreSQL error codes
805
compiled by Johan Dahlin.
807
* psycopg/psycopg.h: applied compatibility macros from PEP 353.
809
* Applied patch 1/3 from Piet Delport; from his email:
811
psycopg2-Py_ssize_t-input.diff adjusts variables used for parameters
812
and return values. These changes only prevent overflowing on values
813
greater than 32-bits, so they're not as critical as the other two
814
patches. I tried to leave places unchanged where the input size is
815
already constrained to sizeof(int), but i might have missed a few
816
either way, not being too familiar with the codebase.
818
* Applied patch 2/3 from Piet Delport; from his email:
820
psycopg2-Py_ssize_t-output.diff adjusts variables used as outputs
821
from CPython API calls: without it the calls try to write 64 bits
822
to 32 bit locations, trampling over adjacent values/pointers,
823
and segfaulting later.
825
* Applied patch 1/3 from Piet Delport; from his email:
827
psycopg2-PyObject_HEAD.diff adds missing underscores to several
828
"PyObject_HEAD" declarations. As far as i can tell from gdb, the
829
"PyObject HEAD" versions end up accidentally meaning almost exactly
830
the same, but get aligned differently on AMD64, resulting in wrong
831
size calculation and memory corruption later.
833
2006-09-11 Federico Di Gregorio <fog@initd.org>
835
* Fixed syntax error in lib/extras.py (see #123)
837
2006-09-02 Federico Di Gregorio <fog@initd.org>
839
* psycopg/adapter_mxdatetime.c, psycopg/psycopgmodule.c: fixed last
840
problem with non-constant initializers.
842
* psycopg/connection_type.c: applied patch from Joerg Sonnenberger
843
to fix a double mutex destroy.
847
* psycopg/cursor_type.c: applied patch from Jason Erickson to
848
build on MSVC and older gcc.
850
2006-09-01 Federico Di Gregorio <fog@initd.org>
854
* Fixed patch from #119, see tracker for details.
856
* Preparing release 2.0.5.
858
* psycopg/psycopgmodule.c: fixed filling of connection errors
859
to include OperationalError.
861
* setup.py: removed pydatetime option from initialize_options
862
to make sure that the value in setup.cfg is used.
864
* psycopg/psycopgmodule.c: applied patch from jdahlin (#120)
865
to have .connect() accept either a string or int as the port
868
* psycopg/adapter_binary.c: applied patch from jdahlin (#119)
869
to fix the segfault on empty binary buffers.
871
* psycopg/connection_type.c: added .status attribute to expose
874
* psycopg/pqpath.c: applied patch from intgr (#117) to fix
875
segfault on null queries.
877
* psycopg/cursor_type.c: applied patch from intgr (#116) to
878
fix bad keyword naming and segfault in .executemany().
880
* ZPsycopgDA/DA.py: applied ImageFile patch from Charlie
883
* lib/pool.py: applied logging patch from Charlie Clark.
884
It will probably get a makeup and be moved to the top-level
887
2006-08-02 Federico Di Gregorio <fog@initd.org>
891
* Fixed bug in float conversion (check for NULL string was
892
erroneously removed in 2.0.3!)
894
2006-07-31 Federico Di Gregorio <fog@initd.org>
898
* psycopg/cursor_type.c: applied patch from jbellis (#113) to
899
allow column selection in .copy_from().
901
* psycopg/psycopgmodule.c: fixed memory leak in custom exceptions
902
(applied patch from #114).
904
2006-07-26 Federico Di Gregorio <fog@initd.org>
906
* psycopg/adapter_datetime.c (pydatetime_str): fixed error
907
in conversion of microseconds for intervals and better algo
908
(thanks to Mario Frasca.)
910
2006-06-18 Federico Di Gregorio <fog@initd.org>
912
* psycopg/adapter_binary.c: same as below.
914
* psycopg/adapter_qstring.c: does not segfault anymore if
915
.getquoted() is called without preparing the qstring with
918
2006-06-15 Federico Di Gregorio <fog@initd.org>
920
* psycopg/typecast_basic.c: fixed problem with bogus
921
conversion when importing gtk (that was crazy, I didn't
922
understand why it happened but the new code just fixes it.)
924
* ZPsycopgDA/db.py: better type analisys, using an hash
925
instead of a series of if (variation on patch from Charlie
928
2006-06-11 Federico Di Gregorio <fog@initd.org>
932
* psycopg/typecast_array.c (typecast_array_cleanup): fixed a
933
problem with typecast_array_cleanup always returning the new
934
string length shorter by 1 (Closes: #93).
936
* psycopg/adapter_binary.c: as below.
938
* psycopg/adapter_qstring.c: wrapped #warning in #ifdef __GCC__
939
because other compilers don't have it and it will just break
940
compilation (patch from jason, our great win32 builder).
942
* psycopg/adapter_list.c: applied patch to adapt an empty list
943
into an empty array and not to NULL (from iGGy, closes: #108).
945
* psycopg/cursor_type.c: applied patch from wkv to avoid
946
under-allocating query space when the parameters are not of the
947
right type (Closes: #110).
949
* psycopg/connection_int.c: applied patch from wkv to avoid off
950
by one allocation of connection encoding string (Closes: #109).
952
2006-06-09 Federico Di Gregorio <fog@initd.org>
956
* Fixed some buglets in ZPsycopgDA (was unable to load due
957
to shorter version number in psycopg module.)
959
2006-06-08 Federico Di Gregorio <fog@initd.org>
963
* ZPsycopgDA/DA.py: removed Browse table for 2.0 release; we'll
966
2006-05-26 Federico Di Gregorio <fog@initd.org>
968
* Applied better PostgreSQL patch from AA.
970
2006-05-24 Federico Di Gregorio <fog@initd.org>
972
* Enabled 8.1.4 security fix only when the version is >= 8.1.4, fall
973
back to old code otherwise.
975
* psycopg/adapter_qstring.c: now quote using PQescapeStringConn if
978
* psycopg/adapter_binary.c: now quote using PQescapeByteaConn if
981
2006-04-38 Federico Di Gregorio <fog@initd.org>
983
* setup.py: fixed little problem with mx_include_dir as suggested
984
by kvc (this closes #102).
986
2006-04-24 Federico Di Gregorio <fog@initd.org>
988
* psycopg/adapter_pboolean.c: added the possibility to format boolean
989
values as "true" and "false" instead of "'t'" and "'f'".
991
2006-03-08 Federico Di Gregorio <fog@initd.org>
993
* lib/extras.py: added .next() to DictCursot to support iteration.
995
2006-03-02 Federico Di Gregorio <fog@initd.org>
997
* psycopg/typecast_array.c (typecast_array_tokenize): removed cast
998
to build without warnings on 64 bit arches.
1000
2006-02-11 Federico Di Gregorio <fog@initd.org>
1002
* Release 2.0 beta 8.
1004
* psycopg/config.h: applied patch from Jason to fix handle leak on
1005
win32, as documented in #92.
1007
2006-02-11 Federico Di Gregorio <fog@initd.org>
1009
* Release 2.0 beta 7.
1011
* psycopg/psycopgmodule.c: applied fix for memory overflow in
1012
connect() (reported by solt, #91.)
1014
* setup.py: applied patch from lbruno.
1016
2006-01-11 Federico Di Gregorio <fog@initd.org>
1018
* setup.py: does not report an error in pg_config unless the pg_config
1019
was explicitly set (allows for building with old options.)
1021
2006-01-06 Daniele Varrazzo <daniele.varrazzo@gmail.com>
1023
* setup.py: libpq.dll not used anymore. win32 setup uses pg_config too.
1025
2006-01-05 Federico Di Gregorio <fog@initd.org>
1027
* psycopg/psycopgmodule.c (psyco_set_error): added function to set extra
1028
parameters on ProgrammingError instances. Also modified all occurances of
1029
PyErr_SetString(ProgrammingError,...) to psycopg_set_error().
1031
* setup.{cfg,py}: we now use pg_config to locate PostgreSQL libraries
1032
and headers (modified patch from lbruno, see #70.)
1034
2006-01-01 Federico Di Gregorio <fog@initd.org>
1036
* Preparing release 2 beta 7.
1038
* MANIFEST.in: we now distrbute pre-built documentation (still need
1039
to add to setup.py the code necessary to build docs as part of the
1042
* psycopg/connection_int.c: PostgreSQL encoding names are now force
1043
uppercase (after all PostgreSQL documentation reports them this way.)
1045
2005-12-11 Federico Di Gregorio <fog@initd.org>
1047
* psycopg/typecast_array.c (typecast_array_cleanup): added functio
1048
to cleanup the "[...]=" part of an array result. This probably will
1049
need some more work for nested arrays but it fixed every test I was
1050
able to write. (Closes: #80)
1052
2005-12-11 Federico Di Gregorio <fog@initd.org>
1054
* setup.py: half-applied patch from Tavis to specify mx_include_dir
1057
* psycopg/typecast.c (typecast_parse_time): cz limit in the while
1058
loop is 6, not 5. This solve the problem with "fractionary" time zones
1061
2005-12-06 Federico Di Gregorio <fog@initd.org>
1063
* lib/extras.py: added .callproc() to DictCursor as suggested
1064
by Philip Semanchuk.
1066
2005-11-29 Federico Di Gregorio <fog@initd.org>
1068
* MANIFEST.in: added docs/async.txt. (Closes: #75)
1070
2005-11-26 Daniele Varrazzo <daniele.varrazzo@gmail.com>
1072
* psycopg/psycopgmodule.c: fixed exceptions refcount.
1074
* Fixed lots of doctrings and added Epydoc-generated docs support.
1076
2005-11-24 Federico Di Gregorio <fog@initd.org>
1078
* sandbox: added all the test and creash-me files to the repository.
1080
* psycopg/typecast.c (typecast_dealloc): now directly calls
1081
PyObject_Del to avoid to segfault.
1083
2005-11-20 Federico Di Gregorio <fog@initd.org>
1085
* psycopg/typecast.c: fixed problem with microseconds conversion by
1086
applying slightly modified patch from Ronnie Mackay.
1088
2005-11-19 Federico Di Gregorio <fog@initd.org>
1090
* lib/extensions.py: COMMITED -> COMMITTED. (Closes: #73)
1092
* doc/extensions.rst: included Daniele's work after minor cosmetic changes
1093
like using the new constants instead of numbers for transaction isolation
1096
2005-11-17 Federico Di Gregorio <fog@initd.org>
1098
* ZPsycopgDA/pool.py: fixed connections leak by using the new name
1099
(PersistentConnectionPool) for the old connection pool class.
1101
2005-11-16 Federico Di Gregorio <fog@initd.org>
1103
* Preparing release 2.0 beta 6.
1105
* psycopg/adapter_mxdatetime.c: fixed all problems with mx conversions.
1107
* psycopg/typecast.c: now the timezone is set correctly even if there
1108
are no microseconds and/or the offset is 0;
1110
* examples/encoding.py: fixed example by using python utf8 encoding for
1113
* lib/__init__.py: very nice hack from Harald Armin Massa to allow
1114
py2exe and similar tools to do their work without problems.
1116
2005-11-15 Federico Di Gregorio <fog@initd.org>
1118
* psycopg/psycopgmodule.c: now bails out with correct exception when one
1119
of the needed modules can't be imported (should fix #32.)
1121
2005-11-14 Federico Di Gregorio <fog@initd.org>
1123
* psycopg/typecast.c: added typecast_parse_date and typecast_parse_time
1124
functions to do locale-safe date/time parsing. This would probably also
1125
speed-up psycopg a little bit.
1127
2005-11-07 Federico Di Gregorio <fog@initd.org>
1129
* psycopg/pqpath.c: fixed problem with uninitialized value (all this was
1130
started by replacing calloc() calls with PyMem_Malloc().)
1132
2005-11-04 Federico Di Gregorio <fog@initd.org>
1134
* psycopg/typecast.c: a lot of changes:
1135
- made typecast a new-style type
1136
- removed coerce code and implemented the richcompare protocol that
1137
allows to compare objects of different types
1138
- much better __cmp__ method that allows to compare two typecast
1139
objects and returns True if any two of the mapped oids match
1140
- any object that can be used as an int works as right-hand operand
1141
in __cmp__ operations
1143
* psycopg/typecast_datetime.c: now typecast_PYINTERVAL_cast limit the
1144
scan to 'len' characters in the string (should fix #65.)
1146
2005-11-03 Federico Di Gregorio <fog@initd.org>
1148
* Applied patch from Daniele Varazzo to enable Decimal on Python
1149
2.3 when the module is available (run-time check, nice.)
1151
2005-10-26 Federico Di Gregorio <fog@initd.org>
1153
* setup.cfg: added include_dirs line for SUSE 9.3.
1155
2005-10-22 Federico Di Gregorio <fog@initd.org>
1157
* psycopg/cursor_type.c: added support for named cursors:
1158
- .fetchXXX() methods now execute a FETCH if the cursor is named
1159
- .execute() executes a DECLARE if the cursor is named
1160
- .execute() fails if a named cursor is used in autocommit
1161
- .executemany() can't be called on named cursors
1162
- .scroll() executes a MOVE if the cursor is named
1163
- .close() executes a CLOSE if the cursor is named
1164
Also, a "transaction mark" was added to both the connection and the
1165
cursor and an exception is raised when using a named cursor unless the
1166
two marks correspond.
1168
* psycopg/connection_int.c: snprintf->PyOS_snprintf.
1170
* psycopg/psycopgmodule.c: snprintf->PyOS_snprintf.
1172
* psycopg/cursor_type.c: changed self->query type from C string to
1173
PyObject* to better manage queries in named cursors.
1175
* psycopg/psycopgmodule.c: cleaned up exception names (now the errors
1176
is printed as psycopg2.Error and not as the confusing
1177
psycopg2._psycopg.Error.)
1179
2005-10-20 Federico Di Gregorio <fog@initd.org>
1181
* lib/pool.py: renamed ThreadedConnectionPool to PersistentConnectionPool
1182
and added a connection pool that allows multiple connections per thread
1183
as ThreadedConnectionPool (courtesy of Daniele Varrazzo.)
1185
2005-10-19 Federico Di Gregorio <fog@initd.org>
1187
* Releasing 2.0 beta 5.
1189
* psycopg/adapter_mxdatetime.c: reverted to old strftime method to format
1190
mx.DateTime objects; the new method didn't worked in some corner-cases.
1191
This makes impossible to have more than 2 decimal places for seconds but
1192
at least we get the time right every time.
1194
2005-10-18 Federico Di Gregorio <fog@initd.org>
1196
* NOTIFY is back end working.
1198
* psycopg/connection_type.c: fixed problem with initialization of
1199
notifies list (also fixed small memory leak in connection dealloc.)
1201
* examples/notify.py: added NOTIFY example.
1203
* psycopg/cursor_type.c: added per-cursor type-casters dictionaries.
1205
2005-10-18 Federico Di Gregorio <fog@initd.org>
1207
* psycopg/typecast.c: temporary fix to typecasting objects to return
1208
False for any comparaison except an integer in self.values (i.e., we
1209
don't raise an exception anymore on a coerce error.) Epydoc is now
1212
* psycopg/config.h: ZETA config.h patch from Charlie Clark.
1214
* examples/threads.py: fixed small typo: psycopg -> psycopg2.
1216
* Big cleanup of unsigned chars to tame gcc 4.
1218
* Big cleanup of module names (i.e., psycopg2._psycopg everywhere.)
1220
* psycopg/config.h: added fake localtime_r for platforms missing it
1222
* psycopg/cursor_type.c: cursors now have a FixedOffsetTimezone
1223
tzinfo_factory by default.
1225
* psycopg/adapter_datetime.c: added tzinfo argument to psycopg2.Time and
1226
psycopg2.Timestamp. Also now TimestampFromTicks sets the tzinfo object
1227
to psycopg2.tz.LOCAL.
1229
2005-10-17 Federico Di Gregorio <fog@initd.org>
1231
* psycopg/adapter_datetime.c: we now use localtime() instead of gmtime()
1232
to accound for the local time-zone in timestamps.
1234
* psycopg/connection_type.c: fixed docstring for .cursor().
1236
* psycopg/psycopgmodule.c: added useful docstring for .connect().
1238
2005-10-08 Federico Di Gregorio <fog@initd.org>
1240
* psycopg/connection_type.c: isolation level upper bound set to 2.
1242
* lib/psycopg1.py: explicitly set isolation level to 2 on .connect()
1243
to mimic psycopg 1 behaviour.
1245
* psycopg/connection_int.c: now set isolation level from
1246
default_transaction_isolation backend environment value.
1248
* psycopg/pqpath.c: removed serialization level 3: now everybody
1249
(except me) has to use the mnemonics defined in psycopg2.extensions.
1251
* lib/extensions.py: Added mnemonics for serialization levels.
1253
2005-10-02 Federico Di Gregorio <fog@debian.org>
1255
* psycopg/cursor_type.c (psyco_curs_callproc): applied callproc
1256
patch from Matt Goodall (added a check on _psyco_curs_execute
1257
return value and substituted malloc/free with PyMem versions.)
1259
2005-10-01 Federico Di Gregorio <fog@debian.org>
1261
* psycopg/connection_int.c: fixed segfault by moving PyErr_Format
1262
after GIL acquisition (closes: #50).
1264
* psycopg/connection_type.c: applied patch from Matt Goodall to
1265
fix some doc strings.
1267
2005-09-23 Federico Di Gregorio <fog@debian.org>
1269
* lib/pool.py: applied patch from piro to avoid the scan of the
1270
whole connection array on getconn().
1272
2005-09-12 Federico Di Gregorio <fog@initd.org>
1274
* lib/pool.py: Applied psycopg->psycopg2 patch to from bug #35.
1276
* ZpsycopgDA/db.py: fixed problem with OperationalError that
1277
resulted in cryptic message to Zope users ("'OperationalError' is
1280
2005-08-23 Federico Di Gregorio <fog@debian.org>
1282
* setup.py: applied patch from Daniele Varrazzo to avoid segfaults
1283
when compiling with migw for Python 2.4.x.
1285
* psycopg/adapter_mxdatetime.c (mxdatetime_str): ported code from 1.1.x
1286
to convert mxDateTime object preserving the precision of fractional
1289
2005-08-22 Federico Di Gregorio <fog@debian.org>
1291
* ZPsycopgDA/*.py: psycopg -> psycopg2.
1293
* setup.py: modified to install the module components under
1294
psycopg2 on windows too (thanks to Daniele Varrazzo.)
1296
2005-08-07 Federico Di Gregorio <fog@debian.org>
1298
* psycopg/config.h: added __sun__ to the symbols checked for round()
1300
2005-07-21 Federico Di Gregorio <fog@debian.org>
1302
* psycopg/adapter_datetime.c (psyco_XXXFromTicks): fixed the 1900
1303
years offset reported by Jeroen van Dongen (see ticket #33).
1305
2005-07-17 Federico Di Gregorio <fog@debian.org>
1307
* Release 2.0 beta 4.
1309
* lib/extras.py (DictConnection.cursor): added DictConnection to
1310
make easier to retrieve data in DictRows.
1312
2005-06-24 Federico Di Gregorio <fog@initd.org>
1314
* psycopg/typecast_datetime.c (typecast_PYINTERVAL_cast): applied patch
1315
from Geert Jansen to fix interval bug due to overflow.
1317
2005-06-18 Federico Di Gregorio <fog@initd.org>
1319
* setup.cfg: some clarifications and include_dirs example for Mandrake.
1321
* ZPsycopgDA/DA.py: DTMLFile -> HTMLFile everywhere to fix zope
1324
* MANIFEST.in: added missing files to do bdist_rpm.
1326
* lib/psycopg1.py: fixed .dictfetchrow() to return None if fetchone()
1327
returns None instead of raising an exception.
1329
* ZPsycopgDA/icons: replaced corrupted icons with good ones.
1331
2005-06-13 Federico Di Gregorio <fog@initd.org>
1333
* psycopg/psycopgmodule.c (psyco_connect): changed the port keyword
1334
parameter type to int (instead of string); this should fix #23.
1336
* psycopg/cursor_type.c (_psyco_curs_execute): now checks for
1337
empty queries and raise a ProgrammingError if appropriate (closes:
1340
* setup.py: psycopg module renamed to psycopg2.
1342
2005-06-02 Federico Di Gregorio <fog@debian.org>
1344
* psycopg/cursor_type.c (_psyco_curs_execute): fixed segfault when
1345
not passing string or unicode to .execute().
1347
2005-06-01 Federico Di Gregorio <fog@debian.org>
1349
* examples/fetch.py: added example about using DECLARE CURSOR.
1351
* psycopg/adapter_datetime.c (psyco_TimestampFromTicks): "Hmmm,
1352
looks like someone forgot that C expects months to start counting
1353
from 0, but the Python date routines start counting from 1." That
1356
2005-05-31 Federico Di Gregorio <fog@debian.org>
1358
* psycopg/cursor_type.c (_psyco_curs_execute): if a
1359
UnicodeEncodeError is raised during the converion of a unicode
1360
query we let it propagate insead of segfaulting.
1362
2005-5-27 Federico Di Gregorio, <fog@lana.initd.org>
1364
* tests/types_basic.py: fixed float and binary tests.
1366
2005-05-26 Federico Di Gregorio <fog@debian.org>
1370
* ZPsycopgDA/db.py (DB.convert_description): isolated description
1371
conversion (and fixed the conversion as per #18).
1373
* ZPsycopgDA/DA.py: fixed again; this time Zope should work for
1374
real. :/ Also fixed the type-casters (psycopg 2 added the extra
1375
cursor parameter) as reported in #18.
1377
* psycopg/psycopgmodule.c (init_psycopg): fixed Python 2.2 build.
1379
2005-05-19 Federico Di Gregorio <fog@debian.org>
1383
* lib/extras.py (DictRow): Some extra methods for DictRow.
1385
* psycopg/cursor_type.c (_psyco_curs_execute): added explict check
1386
to avoid using None as bound variables (very importand for cursor
1387
subclasses calling cursor.execute(self, query, None).
1389
2005-05-18 Federico Di Gregorio <fog@debian.org>
1391
* ZPsycopgDA/DA.py (ALLOWED_PSYCOPG_VERSIONS): updated to work
1392
with 2.0b2 only (will support only the exact version untill final
1395
* setup.py: Applied combined patch from Daniele Varrazzo and Jason
1396
Erickson to build on win32 using MSVC or mingw.
1398
2005-05-15 Federico Di Gregorio <fog@debian.org>
1400
* psycopg/microprotocols.c (microprotocols_adapt): fixed memory
1401
leak on None as suggested by gh (closes: #16).
1403
2005-05-10 Federico Di Gregorio <fog@debian.org>
1405
* lib/extras.py (DictRow): we now save a reference to the index
1406
itself and not to the cursor to avoid problems while accessing
1407
DictRow objects after reusing the cursor for a different query
1408
(using Kevin Jacobs db_row would be much better but DictRow is
1409
just an example, right?)
1411
2005-05-09 Federico Di Gregorio <fog@debian.org>
1413
* Release 2.0 beta 1.
1415
* psycopg/typecast_datetime.c (typecast_PYDATETIME_cast): fixed a
1416
typo (pyDateTimeModuleP->pyDateTimeTypeP) that was causing errors
1417
with infinite datetime values.
1419
* psycopg/adapter_binary.c (binary_str): Py_XINCREF on the buffer
1420
that can be NULL on error.
1422
* psycopg/typecast_binary.*: applied slightly modified
1423
chunk/buffer object patch to allow round-trip of buffer objects
1426
* psycopg/cursor_type.c (psyco_curs_executemany): applied slightly
1427
fixed patch from wrobell to allow iterators in .executemany().
1429
2005-04-18 Federico Di Gregorio <fog@debian.org>
1431
* MANIFEST.in: included debian directory.
1433
2005-04-10 Federico Di Gregorio <fog@debian.org>
1435
* psycopg/adapter_list.*: added list adapter.
1437
* psycopg/microprotocols.c (microprotocol_getquoted): moved
1438
_mogrify_getquoted into utility function in the microprotocols
1441
* setup.py: Added extensive error message on missing datetime
1444
* Applied mingw patch from Daniele Varazzo.
1446
2005-04-03 Federico Di Gregorio <fog@debian.org>
1448
* lib/psycopg1.py (connection.autocommit): added compatibility
1449
.autocommit() method.
1451
* psycopg/psycopgmodule.c (psyco_connect): factory ->
1454
* lib/psycopg1.py: added psycopg 1.1.x compatibility module.
1456
2005-03-29 Federico Di Gregorio <fog@debian.org>
1458
* Applied patch to fix tuple count.
1460
* psycopg/pqpath.c (pq_is_busy): Staring from bug report from
1461
Jason Erickson fixed segfaults due to calling Python function
1462
without holding the GIL.
1464
2005-03-24 Federico Di Gregorio <fog@debian.org>
1466
* psycopg/adapter_binary.c (binary_escape): propagated Andrea's
1467
fix to binary adapter.
1469
* psycopg/adapter_qstring.c (qstring_quote): applied patch from
1470
Andrea Arcangeli to fix allocation failures (>4Gb) on 64 bit
1473
* psycopg/typecast_array.c (typecast_array_tokenize): much better
1476
2005-03-23 Federico Di Gregorio <fog@debian.org>
1478
* psycopg/typecast_basic.c: all the basic casters now respect the
1479
passed string length.
1481
* psycopg/typecast.c (typecast_cast): set curs->caster to self
1482
during the type-casting.
1484
* psycopg/cursor_type.c: added "typecaster" attribute to the
1485
cursor (this is safe, cursors can't be shared among threads and
1486
the attribute is RO.)
1488
2005-03-22 Federico Di Gregorio <fog@debian.org>
1490
* psycopg/typecast_array.c: added some more structure to implement
1493
* scripts/buildtypes.py: new version to include array data.
1495
2005-03-15 Federico Di Gregorio <fog@debian.org>
1497
* lib/extensions.py: Added AsIs import.
1499
2005-03-12 Federico Di Gregorio <fog@debian.org>
1501
* psycopg/cursor.h: removed "qattr", not used anymore and added
1502
"cast", holding the typecaster currently in use.
1506
* psycopg/cursor_type.c (psyco_curs_executemany): implemented as a
1507
wrapper to extract python arguments and then call
1508
_psyco_curs_execute().
1510
* psycopg/cursor_type.c (_psyco_curs_execute): splitted away
1511
python argument parsing from the real execute code, to later allow
1514
* psycopg/cursor_type.c (_psyco_curs_buildrow_fill): modified to
1515
call typecast_cast().
1517
* psycopg/typecast.c (typecast_call/typecast_cast): modified
1518
typecast_call to use the new typecast_cast that avoids one string
1519
conversion on every cast.
1521
2005-03-04 Federico Di Gregorio <fog@initd.org>
1523
* Release 1.99.12.1.
1525
* psycopg/adapter_asis.c (asis_str): changed call to PyObject_Repr
1526
to PyObject_Str to avoid problems with long integers.
1528
2005-03-03 Federico Di Gregorio <fog@debian.org>
1530
* psycopg/typecast.h: added array casting functions.
1532
* scripts/maketypes.sh: does not generate pgversion.h anymore.
1534
* Updated all examples for the release.
1536
2005-03-02 Federico Di Gregorio <fog@debian.org>
1540
* psycopg/adapter_*.c: added __conform__ to all adapters.
1542
* psycopg/adapter_qstring.c (qstring_quote): we now use
1543
PyString_AsStringAndSize() instead of strlen() that would stop at
1544
the first embedded \0 (but note that libpq quoting function will
1545
truncate the string anyway!)
1547
* COPY TO implemented using both old and new (v3) protocol.
1549
* psycopg/pqpath.c (_pq_copy_out_v3): implemented and working.
1551
* psycopg/cursor_type.c (psyco_curs_copy_to): added cursor object
1552
interface for copy_to.
1554
* COPY FROM implemented using both old and new (v3) protocol.
1556
* psycopg/config.h (Dprintf): declaration for asprintf is gone.
1558
* psycopg/pqpath.c (_pq_copy_in_v3): implemented.
1560
2005-03-01 Federico Di Gregorio <fog@debian.org>
1562
* setup.py: now we generate a slighly more verbose version string
1563
that embeds some of the compile options, to facilitate users' bug
1566
* psycopg/cursor_type.c (psyco_curs_copy_from): we now use
1567
PyOS_snprintf instead of asprintf. On some platforms this can be
1568
bad (win32).. if that's your case, get a better platform. :/
1570
* psycopg/microprotocols.c (microprotocols_adapt): fixed small
1571
typo that made adaptation using __conform__ impossible.
1573
2005-02-28 Federico Di Gregorio <fog@debian.org>
1575
* lib/extras.py: removed AsIs adapter (now a built-in); also
1576
removed prepare() method from the adapters that don't use it to
1577
avoid an extra method call at mogrification time.
1579
* psycopg/psycopgmodule.c (psyco_adapters_init): added
1580
initialization of the AsIs adapter (adapts int, long, float and
1583
* psycopg/cursor_type.c (_mogrify_getquoted): reorganized the code
1584
to adapt and then call .getquoted() to obtain the quoted data into
1587
2005-2-27 Federico Di Gregorio <fog@initd.org>
1589
* examples/myfirstrecipe.py: fixed adapter registration.
1591
2005-2-7 Federico Di Gregorio <fog@initd.org>
1593
* setup.py: added patch by Valentino Volonghi to build on MacOS X.
1595
2005-01-29 Federico Di Gregorio <fog@debian.org>
1597
* psycopg/pqpath.c (_pq_fetch_tuples): fixed scale-related
1598
segfault (*fourth* mail from Andrea. Another couple like this and
1599
psycopg 2 will exit alpha at warp speed.)
1601
* psycopg/pqpath.c (pq_fetch): _pq_copy_out_3 -> _pq_copy_out_v3
1602
(second and third mail from Andrea. :/)
1604
* psycopg/cursor_type.c (_psyco_curs_has_write_check): added check
1605
on .write() attribute, fixed compilation problems (first mail from
1608
2005-01-20 Federico Di Gregorio <fog@debian.org>
1610
* lib/extensions.py (register_adapter): added register_adapter
1611
function, exported ISQLQuote in psycopg.extensions.
1613
2005-01-18 Federico Di Gregorio <fog@debian.org>
1615
* psycopg/pqpath.c (_pq_fetch_tuples): ported scale/precision fix
1618
* LICENSE: detailed licensing information. Re-licensed some parts
1619
under BSD-like to allow integration is pysqlite.
1621
2005-01-13 Federico Di Gregorio <fog@debian.org>
1623
* ZPsycopgDA/db.py (DB.query
1624
): ported ZPsycopgDA connection fix
1627
* lib/*.py: added pydoc-friendly messages.
1629
2005-01-12 Federico Di Gregorio <fog@debian.org>
1631
* Added debian directory (thanks to W. Borgert who sent initial
1632
patch based on cdbs.)
1
1634
2004-12-20 Federico Di Gregorio <fog@debian.org>
3
1636
* psycopg/pqpath.c (pq_execute): removed multiple calls to