Merge remote-tracking branch 'origin/pycurl' into planetlab-4_0-branch
[plcapi.git] / psycopg2 / ChangeLog
1 2006-09-02  Federico Di Gregorio  <fog@initd.org>
2
3         * Release 2.0.5.1.
4
5         * psycopg/cursor_type.c: applied patch from Jason Erickson to
6         build on MSVC and older gcc.
7
8 2006-09-01  Federico Di Gregorio  <fog@initd.org>
9
10         * Release 2.0.5.
11
12         * Fixed patch from #119, see tracker for details.
13
14         * Preparing release 2.0.5.
15
16         * psycopg/psycopgmodule.c: fixed filling of connection errors
17         to include OperationalError.
18
19         * setup.py: removed pydatetime option from initialize_options
20         to make sure that the value in setup.cfg is used.
21
22         * psycopg/psycopgmodule.c: applied patch from jdahlin (#120)
23         to have .connect() accept either a string or int as the port
24         parameter.
25
26         * psycopg/adapter_binary.c: applied patch from jdahlin (#119)
27         to fix the segfault on empty binary buffers.
28
29         * psycopg/connection_type.c: added .status attribute to expose
30         the internal status.
31
32         * psycopg/pqpath.c: applied patch from intgr (#117) to fix
33         segfault on null queries.
34
35         * psycopg/cursor_type.c: applied patch from intgr (#116) to
36         fix bad keyword naming and segfault in .executemany().
37
38         * ZPsycopgDA/DA.py: applied ImageFile patch from Charlie
39         Clark.
40
41         * lib/pool.py: applied logging patch from Charlie Clark.
42         It will probably get a makeup and be moved to the top-level
43         module later.
44
45 2006-08-02  Federico Di Gregorio  <fog@initd.org>
46
47         * Release 2.0.4.
48
49         * Fixed bug in float conversion (check for NULL string was
50         erroneously removed in 2.0.3!)
51
52 2006-07-31  Federico Di Gregorio  <fog@initd.org>
53
54         * Release 2.0.3.
55
56         * psycopg/cursor_type.c: applied patch from jbellis (#113) to
57         allow column selection in .copy_from().
58
59         * psycopg/psycopgmodule.c: fixed memory leak in custom exceptions
60         (applied patch from #114).
61
62 2006-07-26  Federico Di Gregorio  <fog@initd.org>
63
64         * psycopg/adapter_datetime.c (pydatetime_str): fixed error
65         in conversion of microseconds for intervals and better algo
66         (thanks to Mario Frasca.)
67
68 2006-06-18  Federico Di Gregorio  <fog@initd.org>
69
70         * psycopg/adapter_binary.c: same as below.
71
72         * psycopg/adapter_qstring.c: does not segfault anymore if 
73         .getquoted() is called without preparing the qstring with 
74         the connection.
75
76 2006-06-15  Federico Di Gregorio  <fog@initd.org>
77
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.)
81
82         * ZPsycopgDA/db.py: better type analisys, using an hash
83         instead of a series of if (variation on patch from Charlie
84         Clark.)
85
86 2006-06-11  Federico Di Gregorio  <fog@initd.org>
87
88         * Release 2.0.2.
89
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).
93
94         * psycopg/adapter_binary.c: as below.
95
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).
99
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).
102
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).
106
107         * psycopg/connection_int.c: applied patch from wkv to avoid off 
108         by one allocation of connection encoding string (Closes: #109).
109
110 2006-06-09  Federico Di Gregorio  <fog@initd.org>
111
112         * Release 2.0.1.
113
114         * Fixed some buglets in ZPsycopgDA (was unable to load due
115         to shorter version number in psycopg module.)
116
117 2006-06-08  Federico Di Gregorio  <fog@initd.org>
118         
119         * Release 2.0.
120
121         * ZPsycopgDA/DA.py: removed Browse table for 2.0 release; we'll
122         add it back later.
123
124 2006-05-26  Federico Di Gregorio  <fog@initd.org>
125
126         * Applied better PostgreSQL patch from AA.
127
128 2006-05-24  Federico Di Gregorio  <fog@initd.org>
129
130         * Enabled 8.1.4 security fix only when the version is >= 8.1.4, fall
131         back to old code otherwise.
132         
133         * psycopg/adapter_qstring.c: now quote using PQescapeStringConn if
134         available. 
135
136         * psycopg/adapter_binary.c: now quote using PQescapeByteaConn if
137         available. 
138
139 2006-04-38  Federico Di Gregorio  <fog@initd.org>
140
141         * setup.py: fixed little problem with mx_include_dir as suggested
142         by kvc (this closes #102).
143
144 2006-04-24  Federico Di Gregorio  <fog@initd.org>
145
146         * psycopg/adapter_pboolean.c: added the possibility to format boolean
147         values as "true" and "false" instead of "'t'" and "'f'".
148
149 2006-03-08  Federico Di Gregorio  <fog@initd.org>
150
151         * lib/extras.py: added .next() to DictCursot to support iteration.
152
153 2006-03-02  Federico Di Gregorio  <fog@initd.org>
154
155         * psycopg/typecast_array.c (typecast_array_tokenize): removed cast
156         to build without warnings on 64 bit arches.
157
158 2006-02-11  Federico Di Gregorio  <fog@initd.org>
159
160         * Release 2.0 beta 8.
161
162         * psycopg/config.h: applied patch from Jason to fix handle leak on
163         win32, as documented in #92.
164
165 2006-02-11  Federico Di Gregorio  <fog@initd.org>
166
167         * Release 2.0 beta 7.
168
169         * psycopg/psycopgmodule.c: applied fix for memory overflow in
170         connect() (reported by solt, #91.)
171
172         * setup.py: applied patch from lbruno.
173
174 2006-01-11  Federico Di Gregorio  <fog@initd.org>
175
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.) 
178
179 2006-01-06  Daniele Varrazzo  <daniele.varrazzo@gmail.com>
180
181         * setup.py: libpq.dll not used anymore. win32 setup uses pg_config too.
182
183 2006-01-05  Federico Di Gregorio  <fog@initd.org>
184
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(). 
188
189         * setup.{cfg,py}: we now use pg_config to locate PostgreSQL libraries
190         and headers (modified patch from lbruno, see #70.)
191
192 2006-01-01  Federico Di Gregorio  <fog@initd.org>
193
194         * Preparing release 2 beta 7.
195
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
198         build process.)
199
200         * psycopg/connection_int.c: PostgreSQL encoding names are now force
201         uppercase (after all PostgreSQL documentation reports them this way.)
202
203 2005-12-11 Federico Di Gregorio <fog@initd.org>
204
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)
209
210 2005-12-11  Federico Di Gregorio  <fog@initd.org>
211
212         * setup.py: half-applied patch from Tavis to specify mx_include_dir
213         in setup.cfg.
214
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
217         and fixes #78. 
218
219 2005-12-06  Federico Di Gregorio  <fog@initd.org>
220
221         * lib/extras.py: added .callproc() to DictCursor as suggested
222         by Philip Semanchuk.
223
224 2005-11-29  Federico Di Gregorio  <fog@initd.org>
225
226         * MANIFEST.in: added docs/async.txt. (Closes: #75)
227
228 2005-11-26  Daniele Varrazzo  <daniele.varrazzo@gmail.com>
229
230         * psycopg/psycopgmodule.c: fixed exceptions refcount.
231
232         * Fixed lots of doctrings and added Epydoc-generated docs support.
233
234 2005-11-24  Federico Di Gregorio  <fog@initd.org>
235
236         * sandbox: added all the test and creash-me files to the repository.
237
238         * psycopg/typecast.c (typecast_dealloc): now directly calls
239         PyObject_Del to avoid to segfault.
240
241 2005-11-20  Federico Di Gregorio  <fog@initd.org>
242
243         * psycopg/typecast.c: fixed problem with microseconds conversion by
244         applying slightly modified patch from Ronnie Mackay.
245
246 2005-11-19  Federico Di Gregorio  <fog@initd.org>
247
248         * lib/extensions.py: COMMITED -> COMMITTED. (Closes: #73)
249
250         * doc/extensions.rst: included Daniele's work after minor cosmetic changes
251         like using the new constants instead of numbers for transaction isolation
252         levels.
253
254 2005-11-17  Federico Di Gregorio  <fog@initd.org>
255
256         * ZPsycopgDA/pool.py: fixed connections leak by using the new name
257         (PersistentConnectionPool) for the old connection pool class.
258
259 2005-11-16  Federico Di Gregorio  <fog@initd.org>
260
261         * Preparing release 2.0 beta 6.
262         
263         * psycopg/adapter_mxdatetime.c: fixed all problems with mx conversions.
264         
265         * psycopg/typecast.c: now the timezone is set correctly even if there
266         are no microseconds and/or the offset is 0;
267
268         * examples/encoding.py: fixed example by using python utf8 encoding for
269         the whole file.
270
271         * lib/__init__.py: very nice hack from Harald Armin Massa to allow
272         py2exe and similar tools to do their work without problems.
273
274 2005-11-15  Federico Di Gregorio  <fog@initd.org>
275
276         * psycopg/psycopgmodule.c: now bails out with correct exception when one
277         of the needed modules can't be imported (should fix #32.)
278
279 2005-11-14  Federico Di Gregorio  <fog@initd.org>
280
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.
284
285 2005-11-07  Federico Di Gregorio  <fog@initd.org>
286
287         * psycopg/pqpath.c: fixed problem with uninitialized value (all this was
288         started by replacing calloc() calls with PyMem_Malloc().)
289
290 2005-11-04  Federico Di Gregorio  <fog@initd.org>
291
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 
300
301         * psycopg/typecast_datetime.c: now typecast_PYINTERVAL_cast limit the
302         scan to 'len' characters in the string (should fix #65.)
303
304 2005-11-03  Federico Di Gregorio  <fog@initd.org>
305
306         * Applied patch from Daniele Varazzo to enable Decimal on Python
307         2.3 when the module is available (run-time check, nice.)
308         
309 2005-10-26  Federico Di Gregorio  <fog@initd.org>
310
311         * setup.cfg: added include_dirs line for SUSE 9.3.
312
313 2005-10-22  Federico Di Gregorio  <fog@initd.org>
314
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.
325
326         * psycopg/connection_int.c: snprintf->PyOS_snprintf.
327
328         * psycopg/psycopgmodule.c: snprintf->PyOS_snprintf.
329
330         * psycopg/cursor_type.c: changed self->query type from C string to
331         PyObject* to better manage queries in named cursors.
332
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.)
336
337 2005-10-20  Federico Di Gregorio  <fog@initd.org>
338
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.)
342
343 2005-10-19  Federico Di Gregorio  <fog@initd.org>
344
345         * Releasing 2.0 beta 5.
346         
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.
351
352 2005-10-18  Federico Di Gregorio  <fog@initd.org>
353
354         * NOTIFY is back end working.
355
356         * psycopg/connection_type.c: fixed problem with initialization of
357         notifies list (also fixed small memory leak in connection dealloc.)
358
359         * examples/notify.py: added NOTIFY example.
360
361         * psycopg/cursor_type.c: added per-cursor type-casters dictionaries.
362
363 2005-10-18  Federico Di Gregorio  <fog@initd.org>
364
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
368         happy.
369
370         * psycopg/config.h: ZETA config.h patch from Charlie Clark.
371
372         * examples/threads.py: fixed small typo: psycopg -> psycopg2.
373
374         * Big cleanup of unsigned chars to tame gcc 4.
375
376         * Big cleanup of module names (i.e., psycopg2._psycopg everywhere.)
377         
378         * psycopg/config.h: added fake localtime_r for platforms missing it
379
380         * psycopg/cursor_type.c: cursors now have a FixedOffsetTimezone
381         tzinfo_factory by default.
382
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.
386
387 2005-10-17  Federico Di Gregorio  <fog@initd.org>
388
389         * psycopg/adapter_datetime.c: we now use localtime() instead of gmtime()
390         to accound for the local time-zone in timestamps.
391
392         * psycopg/connection_type.c: fixed docstring for .cursor().
393
394         * psycopg/psycopgmodule.c: added useful docstring for .connect().
395
396 2005-10-08  Federico Di Gregorio  <fog@initd.org>
397
398         * psycopg/connection_type.c: isolation level upper bound set to 2.
399
400         * lib/psycopg1.py: explicitly set isolation level to 2 on .connect()
401         to mimic psycopg 1 behaviour.
402
403         * psycopg/connection_int.c: now set isolation level from
404         default_transaction_isolation backend environment value.
405
406         * psycopg/pqpath.c: removed serialization level 3: now everybody
407         (except me) has to use the mnemonics defined in psycopg2.extensions.
408
409         * lib/extensions.py: Added mnemonics for serialization levels.
410
411 2005-10-02  Federico Di Gregorio  <fog@debian.org>
412
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.) 
416
417 2005-10-01  Federico Di Gregorio  <fog@debian.org>
418
419         * psycopg/connection_int.c: fixed segfault by moving PyErr_Format
420         after GIL acquisition (closes: #50).
421
422         * psycopg/connection_type.c: applied patch from Matt Goodall to
423         fix some doc strings.
424
425 2005-09-23  Federico Di Gregorio  <fog@debian.org>
426
427         * lib/pool.py: applied patch from piro to avoid the scan of the
428         whole connection array on getconn().
429
430 2005-09-12  Federico Di Gregorio  <fog@initd.org>
431
432         * lib/pool.py: Applied psycopg->psycopg2 patch to from bug #35.
433
434         * ZpsycopgDA/db.py: fixed problem with OperationalError that
435         resulted in cryptic message to Zope users ("'OperationalError' is
436         not defined".)
437         
438 2005-08-23  Federico Di Gregorio  <fog@debian.org>
439
440         * setup.py: applied patch from Daniele Varrazzo to avoid segfaults
441         when compiling with migw for Python 2.4.x.
442
443         * psycopg/adapter_mxdatetime.c (mxdatetime_str): ported code from 1.1.x
444         to convert mxDateTime object preserving the precision of fractional
445         seconds.
446
447 2005-08-22  Federico Di Gregorio  <fog@debian.org>
448
449         * ZPsycopgDA/*.py: psycopg -> psycopg2. 
450
451         * setup.py: modified to install the module components under
452         psycopg2 on windows too (thanks to Daniele Varrazzo.)
453
454 2005-08-07  Federico Di Gregorio  <fog@debian.org>
455
456         * psycopg/config.h: added __sun__ to the symbols checked for round()
457
458 2005-07-21  Federico Di Gregorio  <fog@debian.org>
459
460         * psycopg/adapter_datetime.c (psyco_XXXFromTicks): fixed the 1900
461         years offset reported by Jeroen van Dongen (see ticket #33). 
462
463 2005-07-17  Federico Di Gregorio  <fog@debian.org>
464
465         * Release 2.0 beta 4.
466
467         * lib/extras.py (DictConnection.cursor): added DictConnection to
468         make easier to retrieve data in DictRows.
469
470 2005-06-24  Federico Di Gregorio  <fog@initd.org>
471
472         * psycopg/typecast_datetime.c (typecast_PYINTERVAL_cast): applied patch
473         from Geert Jansen to fix interval bug due to overflow.
474
475 2005-06-18  Federico Di Gregorio  <fog@initd.org>
476
477         * setup.cfg: some clarifications and include_dirs example for Mandrake.
478         
479         * ZPsycopgDA/DA.py: DTMLFile -> HTMLFile everywhere to fix zope
480         cut&paste problems.
481         
482         * MANIFEST.in: added missing files to do bdist_rpm.
483         
484         * lib/psycopg1.py: fixed .dictfetchrow() to return None if fetchone()
485         returns None instead of raising an exception.
486         
487         * ZPsycopgDA/icons: replaced corrupted icons with good ones. 
488
489 2005-06-13  Federico Di Gregorio  <fog@initd.org>
490
491         * psycopg/psycopgmodule.c (psyco_connect): changed the port keyword
492         parameter type to int (instead of string); this should fix #23.
493         
494         * psycopg/cursor_type.c (_psyco_curs_execute): now checks for
495         empty queries and raise a ProgrammingError if appropriate (closes:
496         #24).
497         
498         * setup.py: psycopg module renamed to psycopg2.
499
500 2005-06-02  Federico Di Gregorio  <fog@debian.org>
501
502         * psycopg/cursor_type.c (_psyco_curs_execute): fixed segfault when
503         not passing string or unicode to .execute().
504
505 2005-06-01  Federico Di Gregorio  <fog@debian.org>
506
507         * examples/fetch.py: added example about using DECLARE CURSOR.
508
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
512         was me: fixed.
513
514 2005-05-31  Federico Di Gregorio  <fog@debian.org>
515
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.
519         
520 2005-5-27  Federico Di Gregorio,  <fog@lana.initd.org>
521
522         * tests/types_basic.py: fixed float and binary tests.
523
524 2005-05-26  Federico Di Gregorio  <fog@debian.org>
525
526         * Release 2.0b3.
527
528         * ZPsycopgDA/db.py (DB.convert_description): isolated description
529         conversion (and fixed the conversion as per #18).
530
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.
534
535         * psycopg/psycopgmodule.c (init_psycopg): fixed Python 2.2 build. 
536
537 2005-05-19  Federico Di Gregorio  <fog@debian.org>
538
539         * Release 2.0b2.
540         
541         * lib/extras.py (DictRow): Some extra methods for DictRow.
542
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).
546
547 2005-05-18  Federico Di Gregorio  <fog@debian.org>
548
549         * ZPsycopgDA/DA.py (ALLOWED_PSYCOPG_VERSIONS): updated to work
550         with 2.0b2 only (will support only the exact version untill final
551         2.0 release.)
552
553         * setup.py: Applied combined patch from Daniele Varrazzo and Jason
554         Erickson to build on win32 using MSVC or mingw.
555
556 2005-05-15  Federico Di Gregorio  <fog@debian.org>
557
558         * psycopg/microprotocols.c (microprotocols_adapt): fixed memory
559         leak on None as suggested by gh (closes: #16).
560
561 2005-05-10  Federico Di Gregorio  <fog@debian.org>
562
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?)
568
569 2005-05-09  Federico Di Gregorio  <fog@debian.org>
570
571         * Release 2.0 beta 1.
572
573         * psycopg/typecast_datetime.c (typecast_PYDATETIME_cast): fixed a
574         typo (pyDateTimeModuleP->pyDateTimeTypeP) that was causing errors
575         with infinite datetime values.
576
577         * psycopg/adapter_binary.c (binary_str): Py_XINCREF on the buffer
578         that can be NULL on error.
579
580         * psycopg/typecast_binary.*: applied slightly modified
581         chunk/buffer object patch to allow round-trip of buffer objects
582         (BYTEA columns.) 
583
584         * psycopg/cursor_type.c (psyco_curs_executemany): applied slightly
585         fixed patch from wrobell to allow iterators in .executemany().
586
587 2005-04-18  Federico Di Gregorio  <fog@debian.org>
588
589         * MANIFEST.in: included debian directory.
590
591 2005-04-10  Federico Di Gregorio  <fog@debian.org>
592
593         * psycopg/adapter_list.*: added list adapter. 
594
595         * psycopg/microprotocols.c (microprotocol_getquoted): moved
596         _mogrify_getquoted into utility function in the microprotocols
597         library.
598
599         * setup.py: Added extensive error message on missing datetime
600         headers.
601
602         * Applied mingw patch from Daniele Varazzo. 
603
604 2005-04-03  Federico Di Gregorio  <fog@debian.org>
605
606         * lib/psycopg1.py (connection.autocommit): added compatibility
607         .autocommit() method.
608
609         * psycopg/psycopgmodule.c (psyco_connect): factory ->
610         connection_factory.
611
612         * lib/psycopg1.py: added psycopg 1.1.x compatibility module.
613
614 2005-03-29  Federico Di Gregorio  <fog@debian.org>
615
616         * Applied patch to fix tuple count.
617         
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.
621  
622 2005-03-24  Federico Di Gregorio  <fog@debian.org>
623
624         * psycopg/adapter_binary.c (binary_escape): propagated Andrea's
625         fix to binary adapter.
626
627         * psycopg/adapter_qstring.c (qstring_quote): applied patch from
628         Andrea Arcangeli to fix allocation failures (>4Gb) on 64 bit
629         arches.
630
631         * psycopg/typecast_array.c (typecast_array_tokenize): much better
632         tokenization code.
633
634 2005-03-23  Federico Di Gregorio  <fog@debian.org>
635
636         * psycopg/typecast_basic.c: all the basic casters now respect the
637         passed string length.
638
639         * psycopg/typecast.c (typecast_cast): set curs->caster to self
640         during the type-casting.
641
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.)
645
646 2005-03-22  Federico Di Gregorio  <fog@debian.org>
647
648         * psycopg/typecast_array.c: added some more structure to implement
649         array typecasting.
650
651         * scripts/buildtypes.py: new version to include array data.
652
653 2005-03-15  Federico Di Gregorio  <fog@debian.org>
654
655         * lib/extensions.py: Added AsIs import.
656
657 2005-03-12  Federico Di Gregorio  <fog@debian.org>
658
659         * psycopg/cursor.h: removed "qattr", not used anymore and added
660         "cast", holding the typecaster currently in use.
661
662         * Release 1.99.13.
663
664         * psycopg/cursor_type.c (psyco_curs_executemany): implemented as a
665         wrapper to extract python arguments and then call
666         _psyco_curs_execute().
667
668         * psycopg/cursor_type.c (_psyco_curs_execute): splitted away
669         python argument parsing from the real execute code, to later allow
670         for .executemany().
671
672         * psycopg/cursor_type.c (_psyco_curs_buildrow_fill): modified to
673         call typecast_cast().
674         
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.
678
679 2005-03-04  Federico Di Gregorio  <fog@initd.org>
680
681         * Release 1.99.12.1.
682
683         * psycopg/adapter_asis.c (asis_str): changed call to PyObject_Repr
684         to PyObject_Str to avoid problems with long integers.
685
686 2005-03-03  Federico Di Gregorio  <fog@debian.org>
687
688         * psycopg/typecast.h: added array casting functions.
689
690         * scripts/maketypes.sh: does not generate pgversion.h anymore. 
691
692         * Updated all examples for the release.
693
694 2005-03-02  Federico Di Gregorio  <fog@debian.org>
695
696         * Release 1.99.12.
697         
698         * psycopg/adapter_*.c: added __conform__ to all adapters.
699         
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!)
704         
705         * COPY TO implemented using both old and new (v3) protocol.
706
707         * psycopg/pqpath.c (_pq_copy_out_v3): implemented and working.
708
709         * psycopg/cursor_type.c (psyco_curs_copy_to): added cursor object
710         interface for copy_to.
711
712         * COPY FROM implemented using both old and new (v3) protocol.
713
714         * psycopg/config.h (Dprintf): declaration for asprintf is gone.
715
716         * psycopg/pqpath.c (_pq_copy_in_v3): implemented.
717
718 2005-03-01  Federico Di Gregorio  <fog@debian.org>
719
720         * setup.py: now we generate a slighly more verbose version string
721         that embeds some of the compile options, to facilitate users' bug
722         reports.
723
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. :/
727
728         * psycopg/microprotocols.c (microprotocols_adapt): fixed small
729         typo that made adaptation using __conform__ impossible.
730
731 2005-02-28  Federico Di Gregorio  <fog@debian.org>
732
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.
736
737         * psycopg/psycopgmodule.c (psyco_adapters_init): added
738         initialization of the AsIs adapter (adapts int, long, float and
739         *wonder* None!)
740
741         * psycopg/cursor_type.c (_mogrify_getquoted): reorganized the code
742         to adapt and then call .getquoted() to obtain the quoted data into
743         this new function.
744
745 2005-2-27  Federico Di Gregorio  <fog@initd.org>
746
747         * examples/myfirstrecipe.py: fixed adapter registration. 
748
749 2005-2-7  Federico Di Gregorio  <fog@initd.org>
750
751         * setup.py: added patch by Valentino Volonghi to build on MacOS X.
752
753 2005-01-29  Federico Di Gregorio  <fog@debian.org>
754
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.)
758         
759         * psycopg/pqpath.c (pq_fetch): _pq_copy_out_3 -> _pq_copy_out_v3
760         (second and third mail from Andrea. :/)
761
762         * psycopg/cursor_type.c (_psyco_curs_has_write_check): added check
763         on .write() attribute, fixed compilation problems (first mail from
764         Andrea Arcangeli.)
765
766 2005-01-20  Federico Di Gregorio  <fog@debian.org>
767
768         * lib/extensions.py (register_adapter): added register_adapter
769         function, exported ISQLQuote in psycopg.extensions.
770
771 2005-01-18  Federico Di Gregorio  <fog@debian.org>
772
773         * psycopg/pqpath.c (_pq_fetch_tuples): ported scale/precision fix
774         from psycopg 1.1.
775
776         * LICENSE: detailed licensing information. Re-licensed some parts
777         under BSD-like to allow integration is pysqlite.
778
779 2005-01-13  Federico Di Gregorio  <fog@debian.org>
780
781         * ZPsycopgDA/db.py (DB.query
782         ): ported ZPsycopgDA connection fix
783         from psycopg 1.1.
784
785         * lib/*.py: added pydoc-friendly messages.
786
787 2005-01-12  Federico Di Gregorio  <fog@debian.org>
788
789         * Added debian directory (thanks to W. Borgert who sent initial
790         patch based on cdbs.)
791
792 2004-12-20  Federico Di Gregorio  <fog@debian.org>
793
794         * psycopg/pqpath.c (pq_execute): removed multiple calls to
795         pq_fetch in syncronous DBAPI compatibility mode to solve rowcount
796         problem.
797
798 2004-12-14  Federico Di Gregorio  <fog@debian.org>
799
800         * Mm.. release 1.99.11.
801
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.
806
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.
809
810 2004-12-10  Federico Di Gregorio  <fog@debian.org>
811
812         * psycopg/cursor_type.c: now *all* write or async accesses to the
813         connection object are arbitrated using the connection lock.
814         
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.
818
819         * psycopg/pqpath.c (pq_is_busy): gained status of high-level
820         function with its own blocking and locking.
821
822         * psycopg/cursor.h (EXC_IF_CURS_CLOSED): also checks the
823         connection (a closed connection implies a closed cursor.)
824
825         * psycopg/cursor_type.c: cursor's connection is correctly
826         INCREFfed and DECREFfed.
827
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
832         garbage collected.
833
834 2004-11-20  Federico Di Gregorio  <fog@initd.org>
835
836         * psycopg/cursor_type.c (_mogrify): ported %% fix from 1.1.15. 
837
838 2004-11-20  Federico Di Gregorio  <fog@initd.org>
839
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. 
843
844 2004-11-20  Federico Di Gregorio  <fog@debian.org>
845
846         * psycopg/connection_type.c (psyco_conn_cursor): renamed 'cursor'
847         argument to 'cursor_factory'.
848
849 2004-11-19  Federico Di Gregorio  <fog@debian.org>
850
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.
854         
855         * psycopg/cursor_type.c: changed cursor attribute name from
856         tuple_factory to row_factory.
857
858 2004-10-14  Federico Di Gregorio  <fog@debian.org>
859
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.
863
864         * lib/extras.py (DictCursor.execute): fixed stupid bug with cursor
865         setting self.tuplefactory instead of self.tuple_factory.
866
867 2004-10-02  Federico Di Gregorio  <fog@debian.org>
868
869         * Release 1.99.10.
870         
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. 
874
875         * psycopg/config.h (round): added check for __FreeBSD__ (that
876         should be defined when compiling with gcc, I hope.)
877
878         * setup.py: removed a lot of code now in setup.cfg.
879
880 2004-09-24  Federico Di Gregorio  <fog@debian.org>
881
882         * psycopg/cursor_type.c (cursor_dealloc): fixed small memory leak
883         due to missing disposal of self->pgres.
884
885 2004-9-14  Federico Di Gregorio  <fog@initd.org>
886
887         *  examples/dialtone.py: Added adapt() example by Valentino
888         Volonghi.
889
890 2004-09-14  Federico Di Gregorio  <fog@debian.org>
891
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.
896
897 2004-09-13  Federico Di Gregorio  <fog@debian.org>
898
899         * psycopg/cursor_type.c (_mogrify): and qattr is gone.
900
901 2004-09-05  Federico Di Gregorio  <fog@debian.org>
902
903         * Release 1.99.9 (or, the "twisting by the pool" release).
904
905         * psycopg/pqpath.c (_pq_fetch_tuples): changed to "static void"
906         instead of "static int", no ways for this function to fail.
907
908 2004-09-04  Federico Di Gregorio  <fog@debian.org>
909
910         * psycopg/pqpath.c (_pq_fetch_tuples): ported rowcount fix from
911         1.1.15.
912
913         * ZPsycopgDA/*: ZPsycopgDA back in action, using the new pooling
914         code.
915
916 2004-08-29  Federico Di Gregorio  <fog@debian.org>
917
918         * psycopg/typecast_basic.c (typecast_DECIMAL_cast): added DECIMAL
919         typecaster; it even works :).
920
921         * scripts/buildtypes.py (basic_types): added DECIMAL typecaster
922         for the NUMERIC oid.
923
924         * examples/threads.py: updated threads example to use pooling code. 
925
926         * lib/pool.py: added very simple and thread-safe connection
927         pooling class.
928
929         * psycopg/cursor_type.c (psyco_curs_fetchmany): fixed problem with
930         .fetchall() and .fetchmany() returning None instead of [] on empty
931         result sets.
932
933         * Release 1.99.8.
934
935 2004-08-28  Federico Di Gregorio  <fog@debian.org>
936
937         * psycopg/cursor_type.c (psyco_curs_execute): added processing of
938         unicode queries.
939
940         * examples/encoding.py: much better encoding example, also using
941         the new UNICODE typecaster.
942
943         * psycopg/typecast_basic.c (typecast_UNICODE_cast): added UNICODE
944         typecaster.
945
946         * lib/extensions.py: the encodings dictionary is not available by
947         default but can be accessed from the psycopg.extensions module.
948
949         * psycopg/adapter_qstring.h: remove encoding information from
950         qstring adapter and moved it into psycopg module.
951
952 2004-08-26  Federico Di Gregorio  <fog@debian.org>
953
954         * psycopg/cursor_type.c (_psyco_curs_prefetch): added check for
955         asynchronous fetch by wrong cursor.
956
957         * psycopg/pqpath.c (pq_fetch): fixed backend status message (bug
958         reported by Daniele Varrazzo.)
959
960 2004-07-29  Federico Di Gregorio  <fog@debian.org>
961
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
965         win32.)
966
967 2004-07-21  Federico Di Gregorio  <fog@debian.org>
968
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!)
972
973 2004-07-19  Federico Di Gregorio  <fog@debian.org>
974
975         * psycopg/typecast_datetime.c (typecast_PYINTERVAL_cast): replaced
976         round() with micro() when rounding seconds (fixes bugs reported by
977         Daniele Varrazzo.)
978
979 2004-07-16  Federico Di Gregorio  <fog@debian.org>
980
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.)
985
986         * psycopg/cursor_type.c (psyco_curs_fileno, psyco_curs_isready):
987         added extension methods related to async queries. 
988
989 2004-07-15  Federico Di Gregorio  <fog@debian.org>
990
991         * Release 1.99.7.
992
993         * examples/tz.py: added example about time zones.
994
995         * psycopg/typecast_datetime.c (typecast_PYDATETIME_cast): create
996         FixedOffsetTimezone for postgresql "timestamp with time zone"
997         types.
998
999         * lib/tz.py: added (even more than) needed tzinfo classes.
1000
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.)
1004
1005         * psycopg/cursor_type.c (_psyco_curs_buildrow_with_factory): added
1006         use of tuple factories to fetcXXX methods.
1007
1008         * lib/extras.py: little extra goodies for psycopg.
1009
1010 2004-07-14  Federico Di Gregorio  <fog@debian.org>
1011
1012         * Release 1.99.6. 
1013         
1014         * psycopg/connection_type.c: added .dsn attribute to connection
1015         objects.
1016
1017         * psycopg/cursor_type.c (psyco_curs_mogrify): added .mogrify()
1018         method.
1019
1020         * psycopg/adapter_qstring.c: copy the connection encoding only if
1021         wrapped object is unicode and added table of encodings.
1022
1023 2004-07-13  Federico Di Gregorio  <fog@debian.org>
1024
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.
1031
1032         * lib/extensions.py: added extensions module to clearly separate
1033         psycopg own extensions from DBAPI-2.0
1034
1035 2004-07-10  Federico Di Gregorio  <fog@debian.org>
1036
1037         * psycopg/typecast_datetime.c: ported interval fix from 1.1.x.
1038
1039 2004-05-16  Federico Di Gregorio  <fog@debian.org>
1040
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.) 
1044
1045 2004-04-24  Federico Di Gregorio  <fog@debian.org>
1046
1047         * ported time interval patch by Ross Cohen from 1.1.12.
1048
1049 2004-04-19  Federico Di Gregorio  <fog@debian.org>
1050
1051         * psycopg/typecast_datetime.c (typecast_PYDATE_cast): applied
1052         patch from Jason Erickson: min and max taken from datetime.Date
1053         type.
1054         
1055 2004-04-18  Federico Di Gregorio  <fog@debian.org>
1056
1057         * Applied changes from Jason Erickson to build on win32; see his
1058         (slightly edited) entry below. (Still builds on Linux :)
1059
1060         * psycopg/*.c: removed inclusion of pthread.h from all files
1061         except psycopg/config.h to build on win32 without faking the file.
1062
1063 2004-04-15  Jason Erickson <jerickso@stickpeople.com>
1064  
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 
1069             the library path.
1070           - Setup the include path.
1071           - Have the PSYCOPG_VERSION macro be included with quotes.
1072  
1073         * config.h: Added/Cleaned up Win32 includes, defines, stub functions.
1074  
1075         * typecast.h: Removed ';' after PyObject_HEAD in the
1076         typecastObject structure since Microsoft Visual Studio does not
1077         like it.
1078
1079 2004-04-15  Federico Di Gregorio  <fog@debian.org>
1080
1081         * Release 1.99.5 (bug-fixing and reorganization)
1082
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. 
1087
1088 2004-04-14  Federico Di Gregorio  <fog@debian.org>
1089
1090         * psycopg/psycopgmodule.c (initpsycopg): wrapped initialization of
1091         date/time adapters in #ifdefs to have psycopg compile without mx
1092         or builtin datetime.
1093
1094 2004-04-10  Federico Di Gregorio  <fog@debian.org>
1095
1096         * Release 1.99.4.
1097
1098 2004-04-09  Federico Di Gregorio  <fog@debian.org>
1099
1100         * psycopg/typecast_builtins.c: changed DATE to not include
1101         DATETIME types anymore.
1102
1103         * psycopg/adapter_datetime.c (pydatetime_str): switched from
1104         strftime to isoformat to preserve fractional seconds.
1105
1106 2004-04-08  Federico Di Gregorio  <fog@debian.org>
1107
1108         * psycopg/psycopgmodule.c (psyco_connect): ported sslmode
1109         parameter from 1.1 branch.
1110
1111         * psycopg/adapter_datetime.*: added python built-in datetime
1112         adapters. also added the datetime typecasters (still using mx as
1113         default).
1114
1115         * psycopg/typecast.h: removed aliases, they now live in the right
1116         typecast_xxx.c file.
1117
1118 2004-03-08  Federico Di Gregorio  <fog@debian.org>
1119
1120         * Release 1.99.3 (alpha 4).
1121
1122         * examples/lastrowid.py: and the .lastrowid example is in. 
1123
1124         * psycopg/cursor_type.c (_mogrify): added call to .prepare()
1125         method in both dict and sequence path.
1126
1127         * psycopg/connection_int.c (conn_set_client_encoding): added
1128         encoding-change code.
1129
1130         * psycopg/adapter_qstring.c (qstring_quote): added hard-coded
1131         support for utf8 and latin1 encodings.
1132
1133 2004-03-01  Federico Di Gregorio  <fog@debian.org>
1134
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.)
1138
1139 2004-02-29  Federico Di Gregorio  <fog@debian.org> 
1140
1141         * Release 1.99.2 (alpha 3).
1142         
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.)
1146
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.)
1150
1151         * psycopg/connection_int.c (conn_switch_isolation_level): added
1152         isolation level switching code.
1153
1154         * setup.py: removed all references to PSYCOPG_NEWSTYLE: support
1155         for python < 2.2 has been dropped.
1156
1157         * typecast_basic.c (typecast_BINARY_cast): now binary objects are
1158         returned as true buffers.
1159
1160         * adapter_binary.*: added adapter for buffers and binary (bytea)
1161         objects.
1162
1163         * Release 1.99.1 (alpha 2).
1164
1165         * adapter_mxdatetime.*: added adapters for all mx.DateTime types.
1166
1167 2004-02-28  Federico Di Gregorio  <fog@debian.org>
1168
1169         * cursor_type.c (_mogrify): complete rework of the mogrification
1170         code to use the microprotocols_adapt function.
1171
1172         * typecast_basic.c (typecast_BOOLEAN_cast): we now return real
1173         Py_True and Py_False values.
1174
1175         * microprotocols.h: added very simple microprotocols
1176         implementation to allow for python->postgresql types registry.
1177
1178 2004-01-05  Federico Di Gregorio  <fog@debian.org>
1179
1180         * connection_int.c (conn_commit/conn_rollback): added code to
1181         commit/rollback and connection methods. 
1182
1183 2004-01-04  Federico Di Gregorio  <fog@debian.org>
1184
1185         * cursor_type.c (psyco_curs_fetchone): added fetchone method.
1186
1187 2004-01-03  Federico Di Gregorio  <fog@debian.org>
1188
1189         * added (empty) INSTALL file.
1190
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.
1194
1195 2003-08-01  Federico Di Gregorio  <fog@debian.org>
1196
1197         * cursor_type.c (_mogrify_sequence): added sequence mogrification,
1198         can be done better, on the dict model.
1199
1200 2003-07-28  Federico Di Gregorio  <fog@debian.org>
1201
1202         * typeobj_qstring.c: added quoted strings (can use both own code,
1203         like psycopg 1.x or PQescapeString from lipq.)
1204
1205 2003-07-21  Federico Di Gregorio  <fog@debian.org>
1206
1207         * connection_type.c (psyco_conn_close): added .close()
1208         method. wow.
1209
1210         * cursor_*.c: added basic cursor interface (new-style.)
1211
1212 2003-07-20  Federico Di Gregorio  <fog@debian.org>
1213
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
1217         branch.
1218
1219