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