1 2006-09-02 Federico Di Gregorio <fog@initd.org>
5 * psycopg/cursor_type.c: applied patch from Jason Erickson to
6 build on MSVC and older gcc.
8 2006-09-01 Federico Di Gregorio <fog@initd.org>
12 * Fixed patch from #119, see tracker for details.
14 * Preparing release 2.0.5.
16 * psycopg/psycopgmodule.c: fixed filling of connection errors
17 to include OperationalError.
19 * setup.py: removed pydatetime option from initialize_options
20 to make sure that the value in setup.cfg is used.
22 * psycopg/psycopgmodule.c: applied patch from jdahlin (#120)
23 to have .connect() accept either a string or int as the port
26 * psycopg/adapter_binary.c: applied patch from jdahlin (#119)
27 to fix the segfault on empty binary buffers.
29 * psycopg/connection_type.c: added .status attribute to expose
32 * psycopg/pqpath.c: applied patch from intgr (#117) to fix
33 segfault on null queries.
35 * psycopg/cursor_type.c: applied patch from intgr (#116) to
36 fix bad keyword naming and segfault in .executemany().
38 * ZPsycopgDA/DA.py: applied ImageFile patch from Charlie
41 * lib/pool.py: applied logging patch from Charlie Clark.
42 It will probably get a makeup and be moved to the top-level
45 2006-08-02 Federico Di Gregorio <fog@initd.org>
49 * Fixed bug in float conversion (check for NULL string was
50 erroneously removed in 2.0.3!)
52 2006-07-31 Federico Di Gregorio <fog@initd.org>
56 * psycopg/cursor_type.c: applied patch from jbellis (#113) to
57 allow column selection in .copy_from().
59 * psycopg/psycopgmodule.c: fixed memory leak in custom exceptions
60 (applied patch from #114).
62 2006-07-26 Federico Di Gregorio <fog@initd.org>
64 * psycopg/adapter_datetime.c (pydatetime_str): fixed error
65 in conversion of microseconds for intervals and better algo
66 (thanks to Mario Frasca.)
68 2006-06-18 Federico Di Gregorio <fog@initd.org>
70 * psycopg/adapter_binary.c: same as below.
72 * psycopg/adapter_qstring.c: does not segfault anymore if
73 .getquoted() is called without preparing the qstring with
76 2006-06-15 Federico Di Gregorio <fog@initd.org>
78 * psycopg/typecast_basic.c: fixed problem with bogus
79 conversion when importing gtk (that was crazy, I didn't
80 understand why it happened but the new code just fixes it.)
82 * ZPsycopgDA/db.py: better type analisys, using an hash
83 instead of a series of if (variation on patch from Charlie
86 2006-06-11 Federico Di Gregorio <fog@initd.org>
90 * psycopg/typecast_array.c (typecast_array_cleanup): fixed a
91 problem with typecast_array_cleanup always returning the new
92 string length shorter by 1 (Closes: #93).
94 * psycopg/adapter_binary.c: as below.
96 * psycopg/adapter_qstring.c: wrapped #warning in #ifdef __GCC__
97 because other compilers don't have it and it will just break
98 compilation (patch from jason, our great win32 builder).
100 * psycopg/adapter_list.c: applied patch to adapt an empty list
101 into an empty array and not to NULL (from iGGy, closes: #108).
103 * psycopg/cursor_type.c: applied patch from wkv to avoid
104 under-allocating query space when the parameters are not of the
105 right type (Closes: #110).
107 * psycopg/connection_int.c: applied patch from wkv to avoid off
108 by one allocation of connection encoding string (Closes: #109).
110 2006-06-09 Federico Di Gregorio <fog@initd.org>
114 * Fixed some buglets in ZPsycopgDA (was unable to load due
115 to shorter version number in psycopg module.)
117 2006-06-08 Federico Di Gregorio <fog@initd.org>
121 * ZPsycopgDA/DA.py: removed Browse table for 2.0 release; we'll
124 2006-05-26 Federico Di Gregorio <fog@initd.org>
126 * Applied better PostgreSQL patch from AA.
128 2006-05-24 Federico Di Gregorio <fog@initd.org>
130 * Enabled 8.1.4 security fix only when the version is >= 8.1.4, fall
131 back to old code otherwise.
133 * psycopg/adapter_qstring.c: now quote using PQescapeStringConn if
136 * psycopg/adapter_binary.c: now quote using PQescapeByteaConn if
139 2006-04-38 Federico Di Gregorio <fog@initd.org>
141 * setup.py: fixed little problem with mx_include_dir as suggested
142 by kvc (this closes #102).
144 2006-04-24 Federico Di Gregorio <fog@initd.org>
146 * psycopg/adapter_pboolean.c: added the possibility to format boolean
147 values as "true" and "false" instead of "'t'" and "'f'".
149 2006-03-08 Federico Di Gregorio <fog@initd.org>
151 * lib/extras.py: added .next() to DictCursot to support iteration.
153 2006-03-02 Federico Di Gregorio <fog@initd.org>
155 * psycopg/typecast_array.c (typecast_array_tokenize): removed cast
156 to build without warnings on 64 bit arches.
158 2006-02-11 Federico Di Gregorio <fog@initd.org>
160 * Release 2.0 beta 8.
162 * psycopg/config.h: applied patch from Jason to fix handle leak on
163 win32, as documented in #92.
165 2006-02-11 Federico Di Gregorio <fog@initd.org>
167 * Release 2.0 beta 7.
169 * psycopg/psycopgmodule.c: applied fix for memory overflow in
170 connect() (reported by solt, #91.)
172 * setup.py: applied patch from lbruno.
174 2006-01-11 Federico Di Gregorio <fog@initd.org>
176 * setup.py: does not report an error in pg_config unless the pg_config
177 was explicitly set (allows for building with old options.)
179 2006-01-06 Daniele Varrazzo <daniele.varrazzo@gmail.com>
181 * setup.py: libpq.dll not used anymore. win32 setup uses pg_config too.
183 2006-01-05 Federico Di Gregorio <fog@initd.org>
185 * psycopg/psycopgmodule.c (psyco_set_error): added function to set extra
186 parameters on ProgrammingError instances. Also modified all occurances of
187 PyErr_SetString(ProgrammingError,...) to psycopg_set_error().
189 * setup.{cfg,py}: we now use pg_config to locate PostgreSQL libraries
190 and headers (modified patch from lbruno, see #70.)
192 2006-01-01 Federico Di Gregorio <fog@initd.org>
194 * Preparing release 2 beta 7.
196 * MANIFEST.in: we now distrbute pre-built documentation (still need
197 to add to setup.py the code necessary to build docs as part of the
200 * psycopg/connection_int.c: PostgreSQL encoding names are now force
201 uppercase (after all PostgreSQL documentation reports them this way.)
203 2005-12-11 Federico Di Gregorio <fog@initd.org>
205 * psycopg/typecast_array.c (typecast_array_cleanup): added functio
206 to cleanup the "[...]=" part of an array result. This probably will
207 need some more work for nested arrays but it fixed every test I was
208 able to write. (Closes: #80)
210 2005-12-11 Federico Di Gregorio <fog@initd.org>
212 * setup.py: half-applied patch from Tavis to specify mx_include_dir
215 * psycopg/typecast.c (typecast_parse_time): cz limit in the while
216 loop is 6, not 5. This solve the problem with "fractionary" time zones
219 2005-12-06 Federico Di Gregorio <fog@initd.org>
221 * lib/extras.py: added .callproc() to DictCursor as suggested
224 2005-11-29 Federico Di Gregorio <fog@initd.org>
226 * MANIFEST.in: added docs/async.txt. (Closes: #75)
228 2005-11-26 Daniele Varrazzo <daniele.varrazzo@gmail.com>
230 * psycopg/psycopgmodule.c: fixed exceptions refcount.
232 * Fixed lots of doctrings and added Epydoc-generated docs support.
234 2005-11-24 Federico Di Gregorio <fog@initd.org>
236 * sandbox: added all the test and creash-me files to the repository.
238 * psycopg/typecast.c (typecast_dealloc): now directly calls
239 PyObject_Del to avoid to segfault.
241 2005-11-20 Federico Di Gregorio <fog@initd.org>
243 * psycopg/typecast.c: fixed problem with microseconds conversion by
244 applying slightly modified patch from Ronnie Mackay.
246 2005-11-19 Federico Di Gregorio <fog@initd.org>
248 * lib/extensions.py: COMMITED -> COMMITTED. (Closes: #73)
250 * doc/extensions.rst: included Daniele's work after minor cosmetic changes
251 like using the new constants instead of numbers for transaction isolation
254 2005-11-17 Federico Di Gregorio <fog@initd.org>
256 * ZPsycopgDA/pool.py: fixed connections leak by using the new name
257 (PersistentConnectionPool) for the old connection pool class.
259 2005-11-16 Federico Di Gregorio <fog@initd.org>
261 * Preparing release 2.0 beta 6.
263 * psycopg/adapter_mxdatetime.c: fixed all problems with mx conversions.
265 * psycopg/typecast.c: now the timezone is set correctly even if there
266 are no microseconds and/or the offset is 0;
268 * examples/encoding.py: fixed example by using python utf8 encoding for
271 * lib/__init__.py: very nice hack from Harald Armin Massa to allow
272 py2exe and similar tools to do their work without problems.
274 2005-11-15 Federico Di Gregorio <fog@initd.org>
276 * psycopg/psycopgmodule.c: now bails out with correct exception when one
277 of the needed modules can't be imported (should fix #32.)
279 2005-11-14 Federico Di Gregorio <fog@initd.org>
281 * psycopg/typecast.c: added typecast_parse_date and typecast_parse_time
282 functions to do locale-safe date/time parsing. This would probably also
283 speed-up psycopg a little bit.
285 2005-11-07 Federico Di Gregorio <fog@initd.org>
287 * psycopg/pqpath.c: fixed problem with uninitialized value (all this was
288 started by replacing calloc() calls with PyMem_Malloc().)
290 2005-11-04 Federico Di Gregorio <fog@initd.org>
292 * psycopg/typecast.c: a lot of changes:
293 - made typecast a new-style type
294 - removed coerce code and implemented the richcompare protocol that
295 allows to compare objects of different types
296 - much better __cmp__ method that allows to compare two typecast
297 objects and returns True if any two of the mapped oids match
298 - any object that can be used as an int works as right-hand operand
299 in __cmp__ operations
301 * psycopg/typecast_datetime.c: now typecast_PYINTERVAL_cast limit the
302 scan to 'len' characters in the string (should fix #65.)
304 2005-11-03 Federico Di Gregorio <fog@initd.org>
306 * Applied patch from Daniele Varazzo to enable Decimal on Python
307 2.3 when the module is available (run-time check, nice.)
309 2005-10-26 Federico Di Gregorio <fog@initd.org>
311 * setup.cfg: added include_dirs line for SUSE 9.3.
313 2005-10-22 Federico Di Gregorio <fog@initd.org>
315 * psycopg/cursor_type.c: added support for named cursors:
316 - .fetchXXX() methods now execute a FETCH if the cursor is named
317 - .execute() executes a DECLARE if the cursor is named
318 - .execute() fails if a named cursor is used in autocommit
319 - .executemany() can't be called on named cursors
320 - .scroll() executes a MOVE if the cursor is named
321 - .close() executes a CLOSE if the cursor is named
322 Also, a "transaction mark" was added to both the connection and the
323 cursor and an exception is raised when using a named cursor unless the
324 two marks correspond.
326 * psycopg/connection_int.c: snprintf->PyOS_snprintf.
328 * psycopg/psycopgmodule.c: snprintf->PyOS_snprintf.
330 * psycopg/cursor_type.c: changed self->query type from C string to
331 PyObject* to better manage queries in named cursors.
333 * psycopg/psycopgmodule.c: cleaned up exception names (now the errors
334 is printed as psycopg2.Error and not as the confusing
335 psycopg2._psycopg.Error.)
337 2005-10-20 Federico Di Gregorio <fog@initd.org>
339 * lib/pool.py: renamed ThreadedConnectionPool to PersistentConnectionPool
340 and added a connection pool that allows multiple connections per thread
341 as ThreadedConnectionPool (courtesy of Daniele Varrazzo.)
343 2005-10-19 Federico Di Gregorio <fog@initd.org>
345 * Releasing 2.0 beta 5.
347 * psycopg/adapter_mxdatetime.c: reverted to old strftime method to format
348 mx.DateTime objects; the new method didn't worked in some corner-cases.
349 This makes impossible to have more than 2 decimal places for seconds but
350 at least we get the time right every time.
352 2005-10-18 Federico Di Gregorio <fog@initd.org>
354 * NOTIFY is back end working.
356 * psycopg/connection_type.c: fixed problem with initialization of
357 notifies list (also fixed small memory leak in connection dealloc.)
359 * examples/notify.py: added NOTIFY example.
361 * psycopg/cursor_type.c: added per-cursor type-casters dictionaries.
363 2005-10-18 Federico Di Gregorio <fog@initd.org>
365 * psycopg/typecast.c: temporary fix to typecasting objects to return
366 False for any comparaison except an integer in self.values (i.e., we
367 don't raise an exception anymore on a coerce error.) Epydoc is now
370 * psycopg/config.h: ZETA config.h patch from Charlie Clark.
372 * examples/threads.py: fixed small typo: psycopg -> psycopg2.
374 * Big cleanup of unsigned chars to tame gcc 4.
376 * Big cleanup of module names (i.e., psycopg2._psycopg everywhere.)
378 * psycopg/config.h: added fake localtime_r for platforms missing it
380 * psycopg/cursor_type.c: cursors now have a FixedOffsetTimezone
381 tzinfo_factory by default.
383 * psycopg/adapter_datetime.c: added tzinfo argument to psycopg2.Time and
384 psycopg2.Timestamp. Also now TimestampFromTicks sets the tzinfo object
385 to psycopg2.tz.LOCAL.
387 2005-10-17 Federico Di Gregorio <fog@initd.org>
389 * psycopg/adapter_datetime.c: we now use localtime() instead of gmtime()
390 to accound for the local time-zone in timestamps.
392 * psycopg/connection_type.c: fixed docstring for .cursor().
394 * psycopg/psycopgmodule.c: added useful docstring for .connect().
396 2005-10-08 Federico Di Gregorio <fog@initd.org>
398 * psycopg/connection_type.c: isolation level upper bound set to 2.
400 * lib/psycopg1.py: explicitly set isolation level to 2 on .connect()
401 to mimic psycopg 1 behaviour.
403 * psycopg/connection_int.c: now set isolation level from
404 default_transaction_isolation backend environment value.
406 * psycopg/pqpath.c: removed serialization level 3: now everybody
407 (except me) has to use the mnemonics defined in psycopg2.extensions.
409 * lib/extensions.py: Added mnemonics for serialization levels.
411 2005-10-02 Federico Di Gregorio <fog@debian.org>
413 * psycopg/cursor_type.c (psyco_curs_callproc): applied callproc
414 patch from Matt Goodall (added a check on _psyco_curs_execute
415 return value and substituted malloc/free with PyMem versions.)
417 2005-10-01 Federico Di Gregorio <fog@debian.org>
419 * psycopg/connection_int.c: fixed segfault by moving PyErr_Format
420 after GIL acquisition (closes: #50).
422 * psycopg/connection_type.c: applied patch from Matt Goodall to
423 fix some doc strings.
425 2005-09-23 Federico Di Gregorio <fog@debian.org>
427 * lib/pool.py: applied patch from piro to avoid the scan of the
428 whole connection array on getconn().
430 2005-09-12 Federico Di Gregorio <fog@initd.org>
432 * lib/pool.py: Applied psycopg->psycopg2 patch to from bug #35.
434 * ZpsycopgDA/db.py: fixed problem with OperationalError that
435 resulted in cryptic message to Zope users ("'OperationalError' is
438 2005-08-23 Federico Di Gregorio <fog@debian.org>
440 * setup.py: applied patch from Daniele Varrazzo to avoid segfaults
441 when compiling with migw for Python 2.4.x.
443 * psycopg/adapter_mxdatetime.c (mxdatetime_str): ported code from 1.1.x
444 to convert mxDateTime object preserving the precision of fractional
447 2005-08-22 Federico Di Gregorio <fog@debian.org>
449 * ZPsycopgDA/*.py: psycopg -> psycopg2.
451 * setup.py: modified to install the module components under
452 psycopg2 on windows too (thanks to Daniele Varrazzo.)
454 2005-08-07 Federico Di Gregorio <fog@debian.org>
456 * psycopg/config.h: added __sun__ to the symbols checked for round()
458 2005-07-21 Federico Di Gregorio <fog@debian.org>
460 * psycopg/adapter_datetime.c (psyco_XXXFromTicks): fixed the 1900
461 years offset reported by Jeroen van Dongen (see ticket #33).
463 2005-07-17 Federico Di Gregorio <fog@debian.org>
465 * Release 2.0 beta 4.
467 * lib/extras.py (DictConnection.cursor): added DictConnection to
468 make easier to retrieve data in DictRows.
470 2005-06-24 Federico Di Gregorio <fog@initd.org>
472 * psycopg/typecast_datetime.c (typecast_PYINTERVAL_cast): applied patch
473 from Geert Jansen to fix interval bug due to overflow.
475 2005-06-18 Federico Di Gregorio <fog@initd.org>
477 * setup.cfg: some clarifications and include_dirs example for Mandrake.
479 * ZPsycopgDA/DA.py: DTMLFile -> HTMLFile everywhere to fix zope
482 * MANIFEST.in: added missing files to do bdist_rpm.
484 * lib/psycopg1.py: fixed .dictfetchrow() to return None if fetchone()
485 returns None instead of raising an exception.
487 * ZPsycopgDA/icons: replaced corrupted icons with good ones.
489 2005-06-13 Federico Di Gregorio <fog@initd.org>
491 * psycopg/psycopgmodule.c (psyco_connect): changed the port keyword
492 parameter type to int (instead of string); this should fix #23.
494 * psycopg/cursor_type.c (_psyco_curs_execute): now checks for
495 empty queries and raise a ProgrammingError if appropriate (closes:
498 * setup.py: psycopg module renamed to psycopg2.
500 2005-06-02 Federico Di Gregorio <fog@debian.org>
502 * psycopg/cursor_type.c (_psyco_curs_execute): fixed segfault when
503 not passing string or unicode to .execute().
505 2005-06-01 Federico Di Gregorio <fog@debian.org>
507 * examples/fetch.py: added example about using DECLARE CURSOR.
509 * psycopg/adapter_datetime.c (psyco_TimestampFromTicks): "Hmmm,
510 looks like someone forgot that C expects months to start counting
511 from 0, but the Python date routines start counting from 1." That
514 2005-05-31 Federico Di Gregorio <fog@debian.org>
516 * psycopg/cursor_type.c (_psyco_curs_execute): if a
517 UnicodeEncodeError is raised during the converion of a unicode
518 query we let it propagate insead of segfaulting.
520 2005-5-27 Federico Di Gregorio, <fog@lana.initd.org>
522 * tests/types_basic.py: fixed float and binary tests.
524 2005-05-26 Federico Di Gregorio <fog@debian.org>
528 * ZPsycopgDA/db.py (DB.convert_description): isolated description
529 conversion (and fixed the conversion as per #18).
531 * ZPsycopgDA/DA.py: fixed again; this time Zope should work for
532 real. :/ Also fixed the type-casters (psycopg 2 added the extra
533 cursor parameter) as reported in #18.
535 * psycopg/psycopgmodule.c (init_psycopg): fixed Python 2.2 build.
537 2005-05-19 Federico Di Gregorio <fog@debian.org>
541 * lib/extras.py (DictRow): Some extra methods for DictRow.
543 * psycopg/cursor_type.c (_psyco_curs_execute): added explict check
544 to avoid using None as bound variables (very importand for cursor
545 subclasses calling cursor.execute(self, query, None).
547 2005-05-18 Federico Di Gregorio <fog@debian.org>
549 * ZPsycopgDA/DA.py (ALLOWED_PSYCOPG_VERSIONS): updated to work
550 with 2.0b2 only (will support only the exact version untill final
553 * setup.py: Applied combined patch from Daniele Varrazzo and Jason
554 Erickson to build on win32 using MSVC or mingw.
556 2005-05-15 Federico Di Gregorio <fog@debian.org>
558 * psycopg/microprotocols.c (microprotocols_adapt): fixed memory
559 leak on None as suggested by gh (closes: #16).
561 2005-05-10 Federico Di Gregorio <fog@debian.org>
563 * lib/extras.py (DictRow): we now save a reference to the index
564 itself and not to the cursor to avoid problems while accessing
565 DictRow objects after reusing the cursor for a different query
566 (using Kevin Jacobs db_row would be much better but DictRow is
567 just an example, right?)
569 2005-05-09 Federico Di Gregorio <fog@debian.org>
571 * Release 2.0 beta 1.
573 * psycopg/typecast_datetime.c (typecast_PYDATETIME_cast): fixed a
574 typo (pyDateTimeModuleP->pyDateTimeTypeP) that was causing errors
575 with infinite datetime values.
577 * psycopg/adapter_binary.c (binary_str): Py_XINCREF on the buffer
578 that can be NULL on error.
580 * psycopg/typecast_binary.*: applied slightly modified
581 chunk/buffer object patch to allow round-trip of buffer objects
584 * psycopg/cursor_type.c (psyco_curs_executemany): applied slightly
585 fixed patch from wrobell to allow iterators in .executemany().
587 2005-04-18 Federico Di Gregorio <fog@debian.org>
589 * MANIFEST.in: included debian directory.
591 2005-04-10 Federico Di Gregorio <fog@debian.org>
593 * psycopg/adapter_list.*: added list adapter.
595 * psycopg/microprotocols.c (microprotocol_getquoted): moved
596 _mogrify_getquoted into utility function in the microprotocols
599 * setup.py: Added extensive error message on missing datetime
602 * Applied mingw patch from Daniele Varazzo.
604 2005-04-03 Federico Di Gregorio <fog@debian.org>
606 * lib/psycopg1.py (connection.autocommit): added compatibility
607 .autocommit() method.
609 * psycopg/psycopgmodule.c (psyco_connect): factory ->
612 * lib/psycopg1.py: added psycopg 1.1.x compatibility module.
614 2005-03-29 Federico Di Gregorio <fog@debian.org>
616 * Applied patch to fix tuple count.
618 * psycopg/pqpath.c (pq_is_busy): Staring from bug report from
619 Jason Erickson fixed segfaults due to calling Python function
620 without holding the GIL.
622 2005-03-24 Federico Di Gregorio <fog@debian.org>
624 * psycopg/adapter_binary.c (binary_escape): propagated Andrea's
625 fix to binary adapter.
627 * psycopg/adapter_qstring.c (qstring_quote): applied patch from
628 Andrea Arcangeli to fix allocation failures (>4Gb) on 64 bit
631 * psycopg/typecast_array.c (typecast_array_tokenize): much better
634 2005-03-23 Federico Di Gregorio <fog@debian.org>
636 * psycopg/typecast_basic.c: all the basic casters now respect the
637 passed string length.
639 * psycopg/typecast.c (typecast_cast): set curs->caster to self
640 during the type-casting.
642 * psycopg/cursor_type.c: added "typecaster" attribute to the
643 cursor (this is safe, cursors can't be shared among threads and
644 the attribute is RO.)
646 2005-03-22 Federico Di Gregorio <fog@debian.org>
648 * psycopg/typecast_array.c: added some more structure to implement
651 * scripts/buildtypes.py: new version to include array data.
653 2005-03-15 Federico Di Gregorio <fog@debian.org>
655 * lib/extensions.py: Added AsIs import.
657 2005-03-12 Federico Di Gregorio <fog@debian.org>
659 * psycopg/cursor.h: removed "qattr", not used anymore and added
660 "cast", holding the typecaster currently in use.
664 * psycopg/cursor_type.c (psyco_curs_executemany): implemented as a
665 wrapper to extract python arguments and then call
666 _psyco_curs_execute().
668 * psycopg/cursor_type.c (_psyco_curs_execute): splitted away
669 python argument parsing from the real execute code, to later allow
672 * psycopg/cursor_type.c (_psyco_curs_buildrow_fill): modified to
673 call typecast_cast().
675 * psycopg/typecast.c (typecast_call/typecast_cast): modified
676 typecast_call to use the new typecast_cast that avoids one string
677 conversion on every cast.
679 2005-03-04 Federico Di Gregorio <fog@initd.org>
683 * psycopg/adapter_asis.c (asis_str): changed call to PyObject_Repr
684 to PyObject_Str to avoid problems with long integers.
686 2005-03-03 Federico Di Gregorio <fog@debian.org>
688 * psycopg/typecast.h: added array casting functions.
690 * scripts/maketypes.sh: does not generate pgversion.h anymore.
692 * Updated all examples for the release.
694 2005-03-02 Federico Di Gregorio <fog@debian.org>
698 * psycopg/adapter_*.c: added __conform__ to all adapters.
700 * psycopg/adapter_qstring.c (qstring_quote): we now use
701 PyString_AsStringAndSize() instead of strlen() that would stop at
702 the first embedded \0 (but note that libpq quoting function will
703 truncate the string anyway!)
705 * COPY TO implemented using both old and new (v3) protocol.
707 * psycopg/pqpath.c (_pq_copy_out_v3): implemented and working.
709 * psycopg/cursor_type.c (psyco_curs_copy_to): added cursor object
710 interface for copy_to.
712 * COPY FROM implemented using both old and new (v3) protocol.
714 * psycopg/config.h (Dprintf): declaration for asprintf is gone.
716 * psycopg/pqpath.c (_pq_copy_in_v3): implemented.
718 2005-03-01 Federico Di Gregorio <fog@debian.org>
720 * setup.py: now we generate a slighly more verbose version string
721 that embeds some of the compile options, to facilitate users' bug
724 * psycopg/cursor_type.c (psyco_curs_copy_from): we now use
725 PyOS_snprintf instead of asprintf. On some platforms this can be
726 bad (win32).. if that's your case, get a better platform. :/
728 * psycopg/microprotocols.c (microprotocols_adapt): fixed small
729 typo that made adaptation using __conform__ impossible.
731 2005-02-28 Federico Di Gregorio <fog@debian.org>
733 * lib/extras.py: removed AsIs adapter (now a built-in); also
734 removed prepare() method from the adapters that don't use it to
735 avoid an extra method call at mogrification time.
737 * psycopg/psycopgmodule.c (psyco_adapters_init): added
738 initialization of the AsIs adapter (adapts int, long, float and
741 * psycopg/cursor_type.c (_mogrify_getquoted): reorganized the code
742 to adapt and then call .getquoted() to obtain the quoted data into
745 2005-2-27 Federico Di Gregorio <fog@initd.org>
747 * examples/myfirstrecipe.py: fixed adapter registration.
749 2005-2-7 Federico Di Gregorio <fog@initd.org>
751 * setup.py: added patch by Valentino Volonghi to build on MacOS X.
753 2005-01-29 Federico Di Gregorio <fog@debian.org>
755 * psycopg/pqpath.c (_pq_fetch_tuples): fixed scale-related
756 segfault (*fourth* mail from Andrea. Another couple like this and
757 psycopg 2 will exit alpha at warp speed.)
759 * psycopg/pqpath.c (pq_fetch): _pq_copy_out_3 -> _pq_copy_out_v3
760 (second and third mail from Andrea. :/)
762 * psycopg/cursor_type.c (_psyco_curs_has_write_check): added check
763 on .write() attribute, fixed compilation problems (first mail from
766 2005-01-20 Federico Di Gregorio <fog@debian.org>
768 * lib/extensions.py (register_adapter): added register_adapter
769 function, exported ISQLQuote in psycopg.extensions.
771 2005-01-18 Federico Di Gregorio <fog@debian.org>
773 * psycopg/pqpath.c (_pq_fetch_tuples): ported scale/precision fix
776 * LICENSE: detailed licensing information. Re-licensed some parts
777 under BSD-like to allow integration is pysqlite.
779 2005-01-13 Federico Di Gregorio <fog@debian.org>
781 * ZPsycopgDA/db.py (DB.query
782 ): ported ZPsycopgDA connection fix
785 * lib/*.py: added pydoc-friendly messages.
787 2005-01-12 Federico Di Gregorio <fog@debian.org>
789 * Added debian directory (thanks to W. Borgert who sent initial
790 patch based on cdbs.)
792 2004-12-20 Federico Di Gregorio <fog@debian.org>
794 * psycopg/pqpath.c (pq_execute): removed multiple calls to
795 pq_fetch in syncronous DBAPI compatibility mode to solve rowcount
798 2004-12-14 Federico Di Gregorio <fog@debian.org>
800 * Mm.. release 1.99.11.
802 * psycopg/cursor_type.c (_psyco_curs_prefetch): fixed bug in
803 interaction between the .isready() method and
804 _psyco_curs_prefetch: isready now store away the pgres but leave
805 prefetch do its work.
807 * psycopg/*.c: changed the names of most of the psycopg's built-in
808 types to replect their position in the psycopg._psycopg module.
810 2004-12-10 Federico Di Gregorio <fog@debian.org>
812 * psycopg/cursor_type.c: now *all* write or async accesses to the
813 connection object are arbitrated using the connection lock.
815 * psycopg/cursor_type.c (psyco_curs_isready): now we reset the
816 current async cursor if it is ready, to allow other cursors to
817 .execute() without raising the "transaction in progress" error.
819 * psycopg/pqpath.c (pq_is_busy): gained status of high-level
820 function with its own blocking and locking.
822 * psycopg/cursor.h (EXC_IF_CURS_CLOSED): also checks the
823 connection (a closed connection implies a closed cursor.)
825 * psycopg/cursor_type.c: cursor's connection is correctly
826 INCREFfed and DECREFfed.
828 * psycopg/connection_type.c: removed the cursors list from the
829 connection object. It is not necessary anymore for the connection
830 to know about the cursors and the reference counting will keep the
831 connection alive (but possibly closed) until all cursors are
834 2004-11-20 Federico Di Gregorio <fog@initd.org>
836 * psycopg/cursor_type.c (_mogrify): ported %% fix from 1.1.15.
838 2004-11-20 Federico Di Gregorio <fog@initd.org>
840 * psycopg/cursor_type.c (psyco_curs_execute): added check to raise an
841 exception if a cursor tries to .execute() while an async query is
842 already in execution froma different cursor.
844 2004-11-20 Federico Di Gregorio <fog@debian.org>
846 * psycopg/connection_type.c (psyco_conn_cursor): renamed 'cursor'
847 argument to 'cursor_factory'.
849 2004-11-19 Federico Di Gregorio <fog@debian.org>
851 * psycopg/cursor_type.c (_psyco_curs_buildrow_fill): now standard
852 tuples are filled using PyTuple_SET_ITEM while extended types
853 (created via row_factory) are filled using PySequence_SetItem.
855 * psycopg/cursor_type.c: changed cursor attribute name from
856 tuple_factory to row_factory.
858 2004-10-14 Federico Di Gregorio <fog@debian.org>
860 * psycopg/cursor_type.c (_psyco_curs_buildrow_fill): now we use
861 PySequence_SetItem to avoid problems with containers created from
862 cursor's .tuple_factory attribute.
864 * lib/extras.py (DictCursor.execute): fixed stupid bug with cursor
865 setting self.tuplefactory instead of self.tuple_factory.
867 2004-10-02 Federico Di Gregorio <fog@debian.org>
871 * psycopg/cursor_type.c (_psyco_curs_buildrow_*): unified normal
872 and factory code into the _psyco_curs_buildrow_fill function; no
873 more memory leaks here.
875 * psycopg/config.h (round): added check for __FreeBSD__ (that
876 should be defined when compiling with gcc, I hope.)
878 * setup.py: removed a lot of code now in setup.cfg.
880 2004-09-24 Federico Di Gregorio <fog@debian.org>
882 * psycopg/cursor_type.c (cursor_dealloc): fixed small memory leak
883 due to missing disposal of self->pgres.
885 2004-9-14 Federico Di Gregorio <fog@initd.org>
887 * examples/dialtone.py: Added adapt() example by Valentino
890 2004-09-14 Federico Di Gregorio <fog@debian.org>
892 * psycopg/microprotocols.c (microprotocols_adapt): lots of changes
893 to the microprotocols layer (it is not micro anymore);
894 implementing almost all the PEP 246. The adapter registry is now
895 indexed by (type, protocol) and not by type alone.
897 2004-09-13 Federico Di Gregorio <fog@debian.org>
899 * psycopg/cursor_type.c (_mogrify): and qattr is gone.
901 2004-09-05 Federico Di Gregorio <fog@debian.org>
903 * Release 1.99.9 (or, the "twisting by the pool" release).
905 * psycopg/pqpath.c (_pq_fetch_tuples): changed to "static void"
906 instead of "static int", no ways for this function to fail.
908 2004-09-04 Federico Di Gregorio <fog@debian.org>
910 * psycopg/pqpath.c (_pq_fetch_tuples): ported rowcount fix from
913 * ZPsycopgDA/*: ZPsycopgDA back in action, using the new pooling
916 2004-08-29 Federico Di Gregorio <fog@debian.org>
918 * psycopg/typecast_basic.c (typecast_DECIMAL_cast): added DECIMAL
919 typecaster; it even works :).
921 * scripts/buildtypes.py (basic_types): added DECIMAL typecaster
924 * examples/threads.py: updated threads example to use pooling code.
926 * lib/pool.py: added very simple and thread-safe connection
929 * psycopg/cursor_type.c (psyco_curs_fetchmany): fixed problem with
930 .fetchall() and .fetchmany() returning None instead of [] on empty
935 2004-08-28 Federico Di Gregorio <fog@debian.org>
937 * psycopg/cursor_type.c (psyco_curs_execute): added processing of
940 * examples/encoding.py: much better encoding example, also using
941 the new UNICODE typecaster.
943 * psycopg/typecast_basic.c (typecast_UNICODE_cast): added UNICODE
946 * lib/extensions.py: the encodings dictionary is not available by
947 default but can be accessed from the psycopg.extensions module.
949 * psycopg/adapter_qstring.h: remove encoding information from
950 qstring adapter and moved it into psycopg module.
952 2004-08-26 Federico Di Gregorio <fog@debian.org>
954 * psycopg/cursor_type.c (_psyco_curs_prefetch): added check for
955 asynchronous fetch by wrong cursor.
957 * psycopg/pqpath.c (pq_fetch): fixed backend status message (bug
958 reported by Daniele Varrazzo.)
960 2004-07-29 Federico Di Gregorio <fog@debian.org>
962 * psycopg/typecast_basic.c (typecast_BINARY_cast): reverted to
963 using strings instead of buffers when converting postgresql binary
964 objects (should *temporarily* fix corruption bug reported on
967 2004-07-21 Federico Di Gregorio <fog@debian.org>
969 * psycopg/cursor_type.c: removed __iter__ and next methods from
970 object methods and moved them where they do belong (tp_iter and
971 tp_iternext.) Bug reported by Daniele Varrazzo (again!)
973 2004-07-19 Federico Di Gregorio <fog@debian.org>
975 * psycopg/typecast_datetime.c (typecast_PYINTERVAL_cast): replaced
976 round() with micro() when rounding seconds (fixes bugs reported by
979 2004-07-16 Federico Di Gregorio <fog@debian.org>
981 * psycopg/pqpath.c (pq_set_critical): allow for a custom message
982 insted of the one from PQerrorMessage.
983 (pq_resolve_critical): added argument to specify if connection is
984 to be closed (used to not close it during COPY FROM/TO criticals.)
986 * psycopg/cursor_type.c (psyco_curs_fileno, psyco_curs_isready):
987 added extension methods related to async queries.
989 2004-07-15 Federico Di Gregorio <fog@debian.org>
993 * examples/tz.py: added example about time zones.
995 * psycopg/typecast_datetime.c (typecast_PYDATETIME_cast): create
996 FixedOffsetTimezone for postgresql "timestamp with time zone"
999 * lib/tz.py: added (even more than) needed tzinfo classes.
1001 * psycopg/typecast.c (typecast_call): changed typecast call code
1002 to take the additional cursor parameter, needed for
1003 cursor-dependent type casting (tzinfo & friends.)
1005 * psycopg/cursor_type.c (_psyco_curs_buildrow_with_factory): added
1006 use of tuple factories to fetcXXX methods.
1008 * lib/extras.py: little extra goodies for psycopg.
1010 2004-07-14 Federico Di Gregorio <fog@debian.org>
1014 * psycopg/connection_type.c: added .dsn attribute to connection
1017 * psycopg/cursor_type.c (psyco_curs_mogrify): added .mogrify()
1020 * psycopg/adapter_qstring.c: copy the connection encoding only if
1021 wrapped object is unicode and added table of encodings.
1023 2004-07-13 Federico Di Gregorio <fog@debian.org>
1025 * psycopg/cursor_type.c (_mogrify): moved Dprintf statement to
1026 avoid dereferencing empty pointer (from 1.1.x)
1027 (psyco_curs_execute): now we save the query in self->query instead
1028 of freeing the memory ASAP.
1029 (cursorObject_members): and we finally export the saved query
1030 through the cursor members interface. that's all folks.
1032 * lib/extensions.py: added extensions module to clearly separate
1033 psycopg own extensions from DBAPI-2.0
1035 2004-07-10 Federico Di Gregorio <fog@debian.org>
1037 * psycopg/typecast_datetime.c: ported interval fix from 1.1.x.
1039 2004-05-16 Federico Di Gregorio <fog@debian.org>
1041 * psycopg/typecast_datetime.c (typecast_*_cast): fixed Value error
1042 when seconds > 59 by setting minutes += 1 and seconds -= 60
1043 (reported by Marcel Gsteiger.)
1045 2004-04-24 Federico Di Gregorio <fog@debian.org>
1047 * ported time interval patch by Ross Cohen from 1.1.12.
1049 2004-04-19 Federico Di Gregorio <fog@debian.org>
1051 * psycopg/typecast_datetime.c (typecast_PYDATE_cast): applied
1052 patch from Jason Erickson: min and max taken from datetime.Date
1055 2004-04-18 Federico Di Gregorio <fog@debian.org>
1057 * Applied changes from Jason Erickson to build on win32; see his
1058 (slightly edited) entry below. (Still builds on Linux :)
1060 * psycopg/*.c: removed inclusion of pthread.h from all files
1061 except psycopg/config.h to build on win32 without faking the file.
1063 2004-04-15 Jason Erickson <jerickso@stickpeople.com>
1065 * setup.py: Various changes. The critical ones:
1066 - Make an empty pthread.h file so all the code doing an
1067 #include <pthread.h> will find something.
1068 - Appended the winsock2 library and the PostgreSQL library to
1070 - Setup the include path.
1071 - Have the PSYCOPG_VERSION macro be included with quotes.
1073 * config.h: Added/Cleaned up Win32 includes, defines, stub functions.
1075 * typecast.h: Removed ';' after PyObject_HEAD in the
1076 typecastObject structure since Microsoft Visual Studio does not
1079 2004-04-15 Federico Di Gregorio <fog@debian.org>
1081 * Release 1.99.5 (bug-fixing and reorganization)
1083 * setup.py et al.: moved psycopg to psycopg._psycopg to make
1084 easier to provide high level python-only utilities (like the
1085 promised pooling code). psycopg/__init__.py imports _psycopg and
1086 make all the default DBAPI-2.0 stuff available.
1088 2004-04-14 Federico Di Gregorio <fog@debian.org>
1090 * psycopg/psycopgmodule.c (initpsycopg): wrapped initialization of
1091 date/time adapters in #ifdefs to have psycopg compile without mx
1092 or builtin datetime.
1094 2004-04-10 Federico Di Gregorio <fog@debian.org>
1098 2004-04-09 Federico Di Gregorio <fog@debian.org>
1100 * psycopg/typecast_builtins.c: changed DATE to not include
1101 DATETIME types anymore.
1103 * psycopg/adapter_datetime.c (pydatetime_str): switched from
1104 strftime to isoformat to preserve fractional seconds.
1106 2004-04-08 Federico Di Gregorio <fog@debian.org>
1108 * psycopg/psycopgmodule.c (psyco_connect): ported sslmode
1109 parameter from 1.1 branch.
1111 * psycopg/adapter_datetime.*: added python built-in datetime
1112 adapters. also added the datetime typecasters (still using mx as
1115 * psycopg/typecast.h: removed aliases, they now live in the right
1116 typecast_xxx.c file.
1118 2004-03-08 Federico Di Gregorio <fog@debian.org>
1120 * Release 1.99.3 (alpha 4).
1122 * examples/lastrowid.py: and the .lastrowid example is in.
1124 * psycopg/cursor_type.c (_mogrify): added call to .prepare()
1125 method in both dict and sequence path.
1127 * psycopg/connection_int.c (conn_set_client_encoding): added
1128 encoding-change code.
1130 * psycopg/adapter_qstring.c (qstring_quote): added hard-coded
1131 support for utf8 and latin1 encodings.
1133 2004-03-01 Federico Di Gregorio <fog@debian.org>
1135 * psycopg/connection_int.c (conn_close): does not use libpq
1136 functions on NULL pgconn (this can happen when conn_close is
1137 called after a failed PQconnect.)
1139 2004-02-29 Federico Di Gregorio <fog@debian.org>
1141 * Release 1.99.2 (alpha 3).
1143 * psycopg/cursor_type.c: added .rownumber and .connection
1144 attributes. Also added .scroll(), .next() and .__iter__() methods
1145 (see DBAPI2-.0 extensions on PEP.)
1147 * psycopg/connection_type.c (psyco_conn_set_isolation_level):
1148 added connection method .set_isolation_level(). Also added all
1149 error objects to the connection (see DBAPI2-.0 extensions on PEP.)
1151 * psycopg/connection_int.c (conn_switch_isolation_level): added
1152 isolation level switching code.
1154 * setup.py: removed all references to PSYCOPG_NEWSTYLE: support
1155 for python < 2.2 has been dropped.
1157 * typecast_basic.c (typecast_BINARY_cast): now binary objects are
1158 returned as true buffers.
1160 * adapter_binary.*: added adapter for buffers and binary (bytea)
1163 * Release 1.99.1 (alpha 2).
1165 * adapter_mxdatetime.*: added adapters for all mx.DateTime types.
1167 2004-02-28 Federico Di Gregorio <fog@debian.org>
1169 * cursor_type.c (_mogrify): complete rework of the mogrification
1170 code to use the microprotocols_adapt function.
1172 * typecast_basic.c (typecast_BOOLEAN_cast): we now return real
1173 Py_True and Py_False values.
1175 * microprotocols.h: added very simple microprotocols
1176 implementation to allow for python->postgresql types registry.
1178 2004-01-05 Federico Di Gregorio <fog@debian.org>
1180 * connection_int.c (conn_commit/conn_rollback): added code to
1181 commit/rollback and connection methods.
1183 2004-01-04 Federico Di Gregorio <fog@debian.org>
1185 * cursor_type.c (psyco_curs_fetchone): added fetchone method.
1187 2004-01-03 Federico Di Gregorio <fog@debian.org>
1189 * added (empty) INSTALL file.
1191 * cursor_type.c (cursor_dealloc): added qattr for custom object
1192 quoting using a callable attribute.
1193 (_mogrify): ported new, fixed mogrification code from 1.1.12.
1195 2003-08-01 Federico Di Gregorio <fog@debian.org>
1197 * cursor_type.c (_mogrify_sequence): added sequence mogrification,
1198 can be done better, on the dict model.
1200 2003-07-28 Federico Di Gregorio <fog@debian.org>
1202 * typeobj_qstring.c: added quoted strings (can use both own code,
1203 like psycopg 1.x or PQescapeString from lipq.)
1205 2003-07-21 Federico Di Gregorio <fog@debian.org>
1207 * connection_type.c (psyco_conn_close): added .close()
1210 * cursor_*.c: added basic cursor interface (new-style.)
1212 2003-07-20 Federico Di Gregorio <fog@debian.org>
1214 * psycopg/*: beginning of new source layout. if you think this
1215 changelog is somewhat empty, you're right. look at
1216 doc/ChangeLog-1.x for psycopg 1.x changelog just before the