forked from cuerty/pyvertica
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ChangeLog
2244 lines (1436 loc) · 73.5 KB
/
ChangeLog
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
2010-05-17 Federico Di Gregorio <[email protected]>
* Release 2.2.1.
* Builds again on Windows.
2010-05-16 Federico Di Gregorio <[email protected]>
* Release 2.2.0.
2010-05-15 Federico Di Gregorio <[email protected]>
* typecast.c: Fixed problem related to receiving None from Python
when a string was expected.
2010-05-07 Daniele Varrazzo <[email protected]>
* psycopg/adapter_datetime.c: Fixed TimestampFromTicks for second
values > 59.5.
Bug reported and fixed by Jozsef Szalay on 2010-05-06 at 14:11:59.999920.
* psycopg/adapter_datetime.c: Fixed same bug for TimeFromTicks.
2010-05-04 Daniele Varrazzo <[email protected]>
* Added typecasters for arrays of specific MX/Py time-related types.
* psycopg/adapter_[mx]datetime.c: Explicit cast of the SQL representation
of time-related objects.
2010-05-03 Daniele Varrazzo <[email protected]>
* psycopg/adapter_binary.c: Adapt buffer objects using an explicit cast on
the string literal (bug reported by Peter Eisentraut)
2010-04-20 Daniele Varrazzo <[email protected]>
* lib/pqpath.c: Fixed reference leak in notify reception.
* Notifies are collected if available after every query execution.
2010-04-13 Daniele Varrazzo <[email protected]>
* lib/extensions.py: DECIMAL typecaster imported from _psycopg.
* lib/extensions.py: PY* and MX* time typecaster imported from _psycopg.
2010-04-11 Daniele Varrazzo <[email protected]>
* psycopg/connection_type.c: Correctly parse keywords in connect().
2010-04-07 Daniele Varrazzo <[email protected]>
* psycopg/pqpath.c: Ensure running COPY in blocking mode.
* psycopg/pqpath.c: Free the GIL in blocking operations in V2 COPY FROM.
* psycopg/pqpath.c: Evaluate Python objects only once outside the COPY I/O
loops.
2010-04-05 Federico Di Gregorio <[email protected]>
* Fixed problem with asynchronous NOTIFYs.
* Integrated async pacthes from Jan's git tree.
2010-03-13 Federico Di Gregorio <[email protected]>
* Release 2.0.14.
2010-03-11 Federico Di Gregorio <[email protected]>
* setup.py: one-liner from Devrim GÜNDÜZ to build with PostgreSQL
alpha.
2010-02-28 Federico Di Gregorio <[email protected]>
* psycopg/adapt_decimal.c: Python 2.4 decimal type does not support
.isfinite() and two different calls to ._isinfinity() and ._isnan() are
required. This fixes both a test failure and a segfault.
2010-02-15 Federico Di Gregorio <[email protected]>
* Added new Decimal adapter that correctly converts NaN and infinity
to PostgreSQL NaN numeric values. Also added tests.
2010-02-15 Daniele Varrazzo <[email protected]>
* lib/errorcodes.py: Updated to PostgreSQL 8.4; added lookup() function.
2010-02-12 Daniele Varrazzo <[email protected]>
* Stop the loop variable used to create __all__ leaking in the module.
* Fixed Inet constructor.
* Fixed docstring for 'QueryCanceledError' exception.
2010-02-10 Federico Di Gregorio <[email protected]>
* lib/extensions.py: Binary was not imported from _psycopg; now it is
* lib/__init__: SQL_IN adapter is now automatically registered.
* ZPsycopgDA/db.py: removed logging debug calls; psycopg does
not depend on the logger module.
2010-02-12 Federico Di Gregorio <[email protected]>
* License migration: psycopg2 is now LGPL3 + OpenSSL exception.
* TODO file was never updated so lets remove it.
2010-02-10 Federico Di Gregorio <[email protected]>
* lib/extras.py: fixed register_tstz_w_secs() error as reported by
Karsten Hilbert.
2009-11-25 Federico Di Gregorio <[email protected]>
* psycopg/microprotocols.c: "can't adapt" message now includes full
type information (adapted patch from Eric Chamberlain).
* tests/types_basic.py: fixed test broken by float precision fix.
2009-11-09 Federico Di Gregorio <[email protected]>
* psycopg/adapter_pfloat.c: applied patch from Remy Blankto fix float
loss of precision.
2009-10-04 Federico Di Gregorio <[email protected]>
* Release 2.0.13.
* setup.py: applied patch from Christian Jacobsen to link to static
version of libpq.
* lib/extras.py: added support for UUID arrays.
* psycopg/connection_int.c: applied patch from Richard Davies to avoid
deadlocks with multiple threads using the same connection.
2009-08-08 Federico Di Gregorio <[email protected]>
* Release 2.0.12.
* psycopg/lobject_int.c: fixed problem with writing large data using
lo_write: apparently the large objects code does not like non-blocking
connections.
* setup.py: fixed version detection for PostgreSQL rc, as
suggested by Sok Ann Yap.
* ZPsycopgDA/db.py: applied serialization error retry from Brian
Sutherland.
* Implemented connection.reset() method to reset the connection to
well-know default parameters. This is much faster than closing and
reopening the connection. (Suggested by a bug report by Glenn
Maynard.)
* psycopg/cursor_type.c: unified size macro definitions in COPY TO
and COPY FROM operations: now the buffer for column names is 8192
bytes that should be enough even for very large tables.
2009-05-19 Federico Di Gregorio <[email protected]>
* Applied patch from Robert Munro to fix version check
in ZPsycopgDA.
2009-05-10 Federico Di Gregorio <[email protected]>
* Release 2.0.11.
* lib/extras.py: fixed crash in fetchone() when prefetching using
a RealDictCursor.
* psycopg/cursor_ext.c: now raise correct exception when fetching
using a custom row factory results in an error.
* lib/extras.py: applied DictRow "diet" patch from Marko Kreen.
2009-04-21 Federico Di Gregorio <[email protected]>
* setup.py: applied patch from Elvis Pranskevichus to make
PostgreSQL version detection more robust.
2009-04-20 Federico Di Gregorio <[email protected]>
* Release 2.0.10.
* psycopg/cursor_type.c: patch from Gangadharan to avoid double
free of the cursor when the connection that creates it is closed
implicitly by dealloc.
2009-04-19 Federico Di Gregorio <[email protected]>
* psycopg/connection_type.c: patch from Gangadharan to avoid double
free of the connection object when calling close() implicitly.
* psycopg/connection_type.c: patch from Marko Kreen to implement
get_parameter_status().
* psycopg/connection.*: exposed protocol_version and
server_version attributes on the connection object.
* lib/extras.py: patch from Marko Kreen to implement missing dict
methods in DictRow.
2009-04-04 Federico Di Gregorio <[email protected]>
* connection_int.c(conn_notice_callback): removed all Python
calls because conn_notice_callback() can be called without a lock
on the GIL. Moved processing and cleanup of notices into their
own functions that are called while holding the GIL.
2009-04-01 Federico Di Gregorio <[email protected]>
* Applied patch from Menno Smits to fix failures in test_dates
when executed in older version of Python.
* Applied patch from Menno Smits to fix lobject test failures.
2009-03-08 Federico Di Gregorio <[email protected]>
* microprotocols.c: None is always adapted to NULL to avoid
errors when calling adapt on nested types without first checking
for None.
2009-03-02 Federico Di Gregorio <[email protected]>
* Applied modified patch from Karsten Hilbert to provide a
type-caster able to parse times with seconds in the time zone.
* Applied patch from Menno Smits to avoid problems with DictCursor
when the query is executed by a named cursor. Also added Menno's
tests and uniformed other DictCursor tests.
* psycopg/psycopgmodule.c: fixed unwanted exception when passing an
explicit None to register_type().
* psycopg/config.h: applied patch from Jason Erickson to build
with MSVC. Solaris version of isinf() is now a macro.
2009-02-27 Federico Di Gregorio <[email protected]>
* psycopg/config.h: added check to provide compatible isinf()
for Solaris (thanks to Jeremy Mason.)
2009-02-23 Federico Di Gregorio <[email protected]>
* Release 2.0.9.
2009-02-17 James Henstridge <[email protected]>
* psycopg/utils.c (psycopg_escape_string): same here.
* psycopg/adapter_binary.c (binary_escape): simplify PostgreSQL
version check.
* setup.py (psycopg_build_ext.finalize_options): use a single
define of the PostgreSQL version in a form that can easily be used
by #ifdefs.
* tests/test_dates.py (DatetimeTests, mxDateTimeTests): full test
coverage for datetime and time strings with and without time zone
information.
* psycopg/typecast_datetime.c (typecast_PYDATETIME_cast): adjust
to handle the changes in typecast_parse_time.
(typecast_PYTIME_cast): add support for time zone aware time
values.
* psycopg/typecast_mxdatetime.c (typecast_MXDATE_cast): make sure
that values with time zones are correctly processed (even though
that means ignoring the time zone value).
(typecast_MXTIME_cast): same here.
* psycopg/typecast.c (typecast_parse_time): Update method to parse
second resolution timezone offsets.
* psycopg/typecast.c (typecast_parse_time): Fix up handling of
negative timezone offsets with a non-zero minutes field.
* tests/test_dates.py (DatetimeTests): Add tests for time zone
parsing. The test for HH:MM:SS time zones is disabled because we
don't currently support it.
2009-02-16 Federico Di Gregorio <[email protected]>
* FreeBSD now has round(). Modified config.h as suggested by
Jeroen Ruigrok van der Werven.
2009-02-06 Federico Di Gregorio <[email protected]>
* Applied patch by Markus Demleitner to make executemany() return
the sum of modified rows by executed statements or -1 if any one
statement returns it. This is still DBAPI-2.0 compliant.
2009-01-23 Federico Di Gregorio <[email protected]>
* Fixed problem mailed by Markus Demleitner about Python to
PostgreSQL conversions of "nan" and "inf" floats resulting in
backend errors. Added the new psycopg2.extensions.Float adapter
that correctly handle both values and unit tests. (The opposite
conversion was already working.)
2009-01-20 Federico Di Gregorio <[email protected]>
* Fixed problem reported by Lawrence Oluyede where
register_type() didn't work on connection and cursors
suclasses.
2009-01-10 Federico Di Gregorio <[email protected]>
* psycopg/cursor_type.c: cursor.isready() now raise an exception
when the libpq PQconsumeInput() call fails.
2008-12-04 Federico Di Gregorio <[email protected]>
* psycopg/lobject_type.c: fixed memory leak. The patch was kindly
sent from a psycopg user but I wrongly deleted the email so no
kudos (and I had to fix the problem by myself!)
2008-11-25 Federico Di Gregorio <[email protected]>
* psycopg/cursor_type.c: integrated patch from Alejandro Dubrovsky.
Note that the statically allocated buffer should probably go away
in favor of always allocating the buffer dinamically.
* psycopg/utils.c: modified patch from Alejandro Dubrovsky to
support quoted separators in COPY queries: now all the string
quoting code is in utils.c and the same function is used by
qstrings and everything else (like the COPY code.)
2008-09-24 Federico Di Gregorio <[email protected]>
* lib/extras.py: added inet support and related tests.
2008-09-23 James Henstridge <[email protected]>
* psycopg/psycopg.h (NotSupportedError_doc): clean up
spelling/grammar a bit, using exception description from the PEP.
2008-09-23 Federico Di Gregorio <[email protected]>
* Applied patch from Brian Sutherland that fixes NULL
valus in UUID support.
2008-09-19 Federico Di Gregorio <[email protected]>
* lib/extras.py: added UUID support, modeled after the code
sent by Brian Sutherland.
2008-09-16 Federico Di Gregorio <[email protected]>
* Release 2.0.8.
2008-07-26 Federico Di Gregorio <[email protected]>
* psycopg/connection_type.c: merged get_backend_pid() method
by Casey Duncan.
2008-07-23 James Henstridge <[email protected]>
* psycopg/lobject_type.c (lobject_setup): use
FORMAT_CODE_PY_SSIZE_T in Dprintf() call for 64-bit compatibility
when using Python 2.5 or later.
(lobject_dealloc): same here.
2008-07-18 James Henstridge <[email protected]>
* psycopg/adapter_qstring.c (qstring_traverse): add cyclic GC
traversal for quoted string adapters.
* psycopg/adapter_pboolean.c (pboolean_traverse): add cyclic GC
traversal for boolean adapters.
* psycopg/adapter_mxdatetime.c (mxdatetime_traverse): add cyclic
GC traversal for mxdatetime adapters.
* psycopg/adapter_datetime.c (pydatetime_traverse): add cyclic GC
traversal for datetime adapters.
2008-07-01 James Henstridge <[email protected]>
* psycopg/adapter_binary.c (binary_traverse): add cyclic GC
traversal for binary adapters.
* psycopg/adapter_asis.c (asis_traverse): add cyclic GC traversal
for AsIs adapters.
* psycopg/adapter_list.c (list_traverse): add cyclic GC traversal
for list adapters.
2008-05-28 James Henstridge <[email protected]>
* psycopg/cursor_type.c (cursor_setup): incref before setting
attributes, to make things GC-safe.
* psycopg/cursor_int.c (curs_reset): make clearing of description
and casts attributes GC-safe.
* psycopg/typecast.c (typecast_traverse): implement cyclic GC
traversal for typecasters.
* psycopg/connection_type.c:
* psycopg/cursor_type.c: add support for cyclic GC traversal (no
support for clearing).
* psycopg/python.h: add definitions for Py_CLEAR() and Py_VISIT()
for compatibility with old versions of Python.
2008-06-28 Federico Di Gregorio <[email protected]>
* setup.py: fixed problem with spaces in pg_config path.
2008-05-27 Federico Di Gregorio <[email protected]>
* psycopg/pqpath.c: better error checks in _pq_copy_in_v3 to
avoid calling blocking libpq functions when the connection to
the server has been broken
2008-05-19 Federico Di Gregorio <[email protected]>
* psycopg/cursor_type.c: fixed memory leak in .executemany(); on
error "iter" was not dec'reffed.
2008-05-06 James Henstridge <[email protected]>
* psycopg/lobject.h (lobjectObject): remove "mode" struct member,
since it was unused.
* psycopg/lobject_*.c: replace uses of the closed struct member,
and change the Python level attribute to a getset.
* psycopg/lobject.h (lobjectObject): remove the closed member,
since "fd < 0" gives us the same information. Reorder the struct
members for better packing.
* psycopg/lobject*: const'ify the code.
* tests/test_lobject.py (LargeObjectTests): add more tests,
including behaviour on closed lobjects and stale lobjects.
* psycopg/lobject_type.c (psyco_lobj_close): don't mark the
connection closed here because it is done by
lobject_close_locked().
* psycopg/lobject_int.c (lobject_open): mark objects as not closed
if we successfully open them.
(lobject_close_locked): mark the lobject closed here.
(lobject_export): ensure we are in a transaction, since
lo_export() issues multiple queries.
* psycopg/lobject_type.c (lobject_setup): make lobjects start closed.
2008-05-05 James Henstridge <[email protected]>
* psycopg/lobject.h: don't export the lobjectType symbol.
2008-05-05 Federico Di Gregorio <[email protected]>
* Fixed sun build problem by adding "sun" to config.h checks.
2008-05-05 James Henstridge <[email protected]>
* psycopg/pqpath.c (pq_complete_error): get rid of double free
error in case when pgres is NULL.
* tests/test_lobject.py: add some basic tests for large object
code.
* psycopg/lobject*.[ch]: port the large object code to work with
current psycopg code.
2006-09-01 Federico Di Gregorio <[email protected]>
* psycopg/connection_type.c: merged in double mutex destroy patch
from Joerg Sonnenberger.
* Implemented large objects support.
* psycopg/connection_int.c: removed increment of self->mark,
now it is done directly in pqpath.c to make sure even the
large object support gets it.
* Starting 2.1 development.
2008-04-21 James Henstridge <[email protected]>
* tests/test_quote.py (QuotingTestCase.test_unicode): If the
server encoding is not UTF8, skip the unicode test and emit a
warning.
2008-04-21 Jorgen Austvik <[email protected]>
* tests/*.py: use the DSN constructed in tests/__init__.py.
* tests/__init__.py: allow setting the host, port and user for the
DSN used by the tests through the environment.
2008-03-17 Federico Di Gregorio <[email protected]>
* Release 2.0.7.
2008-03-31 James Henstridge <[email protected]>
* psycopg/connection_type.c (connection_dealloc): free
connection->encoding with free() instead of PyMem_Free().
* psycopg/connection_int.c (conn_connect): use malloc() to
allocate connection->encoding instead of PyMem_Malloc(), since it
is freed in other places with free() and assigned to with
strdup().
2008-03-26 James Henstridge <[email protected]>
* psycopg/typecast.c (typecast_from_c): fix up some reference
leaks. This leak affected a bounded set of objects, so doesn't
account for any gradual leaks.
2008-03-19 James Henstridge <[email protected]>
* psycopg/connection_int.c (conn_notice_callback): don't leak
notice messages.
2008-03-17 Federico Di Gregorio <[email protected]>
* psycopg/adapter_datetime.c: fixed double decref when using
a PyObject as a parameter in a nested call (line 415).
2008-03-17 James Henstridge <[email protected]>
* psycopg/typecast.c (typecast_parse_time): give the correct
return value for partially parsed time values.
* psycopg/typecast_mxdatetime.c (typecast_MXDATE_cast): return
NULL after setting DataError. Also, don't treat it as an error if
typecast_parse_time() returns 0 (as might happen if the remainder
of the string is " BC").
* psycopg/typecast_datetime.c (typecast_PYDATE_cast): return NULL
after setting DataError.
(typecast_PYDATETIME_cast): same here.
(typecast_PYTIME_cast): same here.
* tests/test_dates.py
(CommonDatetimeTestsMixin.test_parse_incomplete_date): test that
parsing incomplete date values results in DataError.
(CommonDatetimeTestsMixin.test_parse_incomplete_time): same for
times.
(CommonDatetimeTestsMixin.test_parse_incomplete_time): same for
datetimes.
2008-03-07 Jason Erickson <[email protected]>
* psycopg/pqpath.c (pq_raise): if PSYCOPG_EXTENSIONS is not
defined, raise OperationalError rather than
TransactionRollbackError for deadlock or serialisation errors for
protocol versions less than 3.
* psycopg/psycopgmodule.c (psyco_connect): fix off by one error in
calculating the length of the DSN.
2008-03-07 James Henstridge <[email protected]>
* psycopg/pqpath.c (_pq_fetch_tuples): Don't call Python APIs
without holding the GIL.
2008-02-27 James Henstridge <[email protected]>
* NEWS: add some draft NEWS items for a 2.0.7 release.
* runtests.py: add a harness to run all the psycopg tests against
the version built by distutils.
2008-01-22 James Henstridge <[email protected]>
* psycopg/typecast.c (typecast_pydatetime): make array static.
(typecast_mxdatetime): same here.
* psycopg/typecast_builtins.c (typecast_builtins): make array
static.
* psycopg/psycopgmodule.c: add hidden visibility to a bunch of
global variables here.
* psycopg/psycopg.h: add set QueryCanceledError and
TransactionRollbackError to hidden visibility.
* psycopg/*.[ch]: add const qualifier to various string arguments
to functions (typecast functions and conn_switch_isolation_level).
2008-01-21 James Henstridge <[email protected]>
* setup.cfg (define): remove PSYCOPG_DISPLAY_SIZE from default
list of defines, as discussed on mailing list. It slows down
queries with very little benefit.
* psycypg/*.h: apply HIDDEN to all global variables and functions
that should not be exported from the module. This results in a 5%
reduction in code size and shortens the dynamic symbol table.
* psycopg/config.h: If GCC >= 4.0 is installed, define the HIDDEN
symbol to apply the "hidden" visibility attribute.
2008-01-19 James Henstridge <[email protected]>
* tests/test_connection.py (ConnectionTests): add simple tests for
the Connection and Cursor "closed" attributes.
* psycopg/cursor_type.c (psyco_curs_get_closed): add a "closed"
attribute to cursors. It will be True if either the cursor or its
associated connection are closed. This fixes bug #164.
* psycopg/pqpath.c (pq_raise): remove unused arguments to
function, and simplify.
(pq_resolve_critical): make function static, since it isn't being
used outside of pqpath.c any more.
2008-01-17 James Henstridge <[email protected]>
* ZPsycopgDA/DA.py (Connection.__init__): Default the encoding to
UTF-8, fixing bug #190.
(App.ImageFile): simplify ImageFile import using patch from
chrism, fixing bug #198.
2008-01-16 James Henstridge <[email protected]>
* tests/test_transaction.py (DeadlockSerializationTestCase): port
over some tests for serialisation and deadlock errors,
demonstrating that TransactionRollbackError is generated.
(QueryCancelationTests): add a test to show that
QueryCanceledError is raised on statement timeouts.
* psycopg2da/adapter.py (_handle_psycopg_exception): rather than
checking exception messages, check for TransactionRollbackError.
* psycopg/pqpath.c (exception_from_sqlstate): return
TransactionRollbackError for 40xxx errors, and QueryCanceledError
for 57014 errors.
(pq_raise): If we are using an old server, use
TransactionRollbackError if the error message contains "could not
serialize" or "deadlock detected".
* psycopg/psycopgmodule.c (_psyco_connect_fill_exc): remove
function, since we no longer need to store pointers to the
exceptions in the connection. This also fixes a reference leak.
(psyco_connect): remove _psyco_connect_fill_exc() function call.
* psycopg/connection.h (connectionObject): remove exception
members from struct.
* psycopg/connection_type.c (connectionObject_getsets): modify the
exception attributes on the connection object from members to
getsets. This reduces the size of the struct.
* lib/extensions.py: import the two new extensions.
* psycopg/psycopgmodule.c (exctable): add new QueryCanceledError
and TransactionRollbackError exceptions.
2008-01-16 James Henstridge <[email protected]>
* tests/__init__.py (test_suite): add date tests to test suite.
* tests/test_dates.py: add tests for date/time typecasting and
adaption.
* psycopg/adapter_mxdatetime.c (mxdatetime_str): add support for
outputting BC dates (which involves switching them to one-based
dates). Also remove broken handling of microseconds.
* psycopg/typecast.c (typecast_parse_date): if the string ends
with "BC" adjust the year value to be a zero-based BC value as
used by mx.DateTime (datetime doesn't support BC dates).
(typecast_parse_time): ignore ' ', 'B' and 'C' in time strings
rather than treating them as part of the seconds part of the time.
2008-01-14 James Henstridge <[email protected]>
* psycopg/typecast_array.c (typecast_array_scan): set an initial
value for quotes to keep gcc happy.
* psycopg/*.c: add missing static modifier on many functions.
2008-01-12 James Henstridge <[email protected]>
* tests/test_transaction.py
(TransactionTestCase.test_failed_commit): Expect IntegrityError
instead of OperationalError.
* psycopg/pqpath.c (exception_from_sqlstate): new function that
converts an SQLSTATE error code to the corresponding exception
class.
(pq_raise): use exception_from_sqlstate() to pick which exception
to use when working with protocol version 3.
(pq_complete_error): Let pq_raise() pick an appropriate exception
rather than forcing OperationalError.
2008-01-11 James Henstridge <[email protected]>
* psycopg/adapter_binary.c (binary_quote): apply Brandon Rhodes'
patch from ticket #209 to check return value from
PyObject_AsCharBuffer(). This fixes the segfault.
(binary_quote): switch from PyObject_AsCharBuffer() to
PyObject_AsReadBuffer() to support buffer objects that don't
implement the bf_getcharbuf protocol.
* tests/types_basic.py (TypesBasicTests.testBinary): Test round
tripping of bytea buffers. Currently segfaults.
* psycopg/connection_int.c (conn_close): fix for new
pq_abort_locked() prototype.
(conn_switch_isolation_level): fix for new pq_abort_locked()
prototype, and use pq_complete_error() to show error message.
(conn_set_client_encoding): same here.
* psycopg/pqpath.c (pq_execute_command_locked): remove static
modifier.
(pq_complete_error): same here.
(pq_abort_locked): add pgres and error arguments.
(pq_abort): call pq_abort_locked() to reduce code duplication.
2007-12-23 James Henstridge <[email protected]>
* psycopg/pqpath.c (pq_execute_command_locked): add an error
argument to hold an error when no PGresult is returned by PQexec,
rather than using pq_set_critical().
(pq_complete_error): new function that converts the error returned
by pq_execute_command_locked() to a Python exception.
(pq_begin_locked): add error argument.
(pq_commit): use pq_complete_error().
(pq_abort): use pq_complete_error().
(pq_abort_locked): always call pq_set_critical() on error, and
clear the error message from pq_execute_command_locked().
(pq_execute): use pq_complete_error() to handle the error from
pq_begin_locked().
* psycopg/pqpath.c (pq_begin): remove unused function.
* psycopg/connection_type.c (psyco_conn_commit): if conn_commit()
raises an error, just return NULL, since it is now setting an
exception itself.
(psyco_conn_rollback): same here.
* psycopg/connection_int.c (conn_commit): don't drop GIL and lock
connection before calling pq_commit().
(conn_rollback): same here.
(conn_close): use pq_abort_locked().
(conn_switch_isolation_level): same here.
(conn_set_client_encoding): same here.
* psycopg/pqpath.h: add prototype for pq_abort_locked().
* psycopg/pqpath.c (pq_commit): convert function to run with GIL
held, and handle errors appropriately.
(pq_abort): same here.
(pq_abort_locked): new function to abort a locked connection.
2007-12-22 James Henstridge <[email protected]>
* psycopg/pqpath.c (pq_raise): add a "pgres" argument so we can
generate nice errors not related to a particular cursor.
(pq_execute): use pq_begin_locked() rather than pq_begin(). Use
pq_raise() to handle any errors from it.
* psycopg/pqpath.c (pq_execute_command_locked): helper function
used to execute a command-style query on a locked connection.
(pq_begin_locked): a variant of pq_begin() that uses
pq_execute_command_locked().
(pq_begin): rewrite to use pq_begin_locked().
2007-12-22 James Henstridge <[email protected]>
* psycopg/config.h: only print debug messages if
psycopg_debug_enabled is true.
* psycopg/psycopgmodule.c (init_psycopg): set
psycopg_debug_enabled to true if the $PSYCOPG_DEBUG environment
variable is set.
2007-12-21 Federico Di Gregorio <[email protected]>
* Applied win32 patch from Jason Erickson.
* Applied patch from Thomas Lotze to use correct version
for new Zopes.
2007-12-20 James Henstridge <[email protected]>
* psycopg/pqpath.c (pq_execute): uncomment the "curs->pgres ==
NULL" error handler after the PQexec() call. This is needed to
catch database disconnects (and probably other errors). According
to Federico, it was commented out to avoid a spurious error, so we
should watch for problems.
2007-12-20 James Henstridge <[email protected]>
* psycopg/pqpath.c (pq_raise): only remove the first 8 characters
of the exception message if it actually gives the severity.
* psycopg/pqpath.h (pq_resolve_critical): add prototype, since
this function is being used from connection_int.c.
* psycopg/psycopg.h: update psyco_set_error() prototype.
* psycopg/psycopgmodule.c (psyco_errors_init): set pgerror, pgcode
and cursor class attributes to None on psycopg2.Error so that the
attributes will always be available (simplifies error handling).
(psyco_set_error): add const qualifiers to msg, pgerror and pgcode
arguments.
Don't bother setting pgerror, pgcode or cursor to None if they are
not provided -- the class defaults take care of this.
2007-11-11 Daniele Varrazzo <[email protected]>
* Use escape string syntax for string escape if connected to a
server requiring it.
2007-11-09 Daniele Varrazzo <[email protected]>
* Use escape string syntax for binary escape if connected to a
server requiring it.
* Put a limit on the number of notices stored in the connection.
2007-10-21 Daniele Varrazzo <[email protected]>
* Fixed bug #192 (Decimal support not safe for use with multiple sub
interpreters) as proposed by Graham Dumpleton.
2007-09-08 Federico Di Gregorio <[email protected]>
* Added MonoDevelop project, yahi!
2007-09-06 Federico Di Gregorio <[email protected]>
* Fixed bug #194.
2007-09-01 Federico Di Gregorio <[email protected]>
* Added "name" parameter to all .cursor() calls in extras.py.
2007-05-29 Federico Di Gregorio <[email protected]>
* Release 2.0.6.
* ZPsycopgDA/DA.py: removed call to now obsolete .set_type_casts().
* Applied patch from mkz (ticket #187) to add error handling when
calling conn_commit() and conn_rollback(). Fixes #187.
* cursor.copy_expert() implementation by David Rushby (copy_expert
set 5/5.)
* SQL validation refactor patch from David Rushby (copy_expert
set 4/5.)
* Reference count leak fix from David Rushby (copy_expert set 3/5.)
* 64 bit fix patch from David Rushby (copy_expert set 2/5.)
* Applied whitespace normalization patch from David Rushby (copy_expert
set 1/5.)
2007-04-25 Federico Di Gregorio <[email protected]>
* psycopg/connection_type.c: added support for a new method
.get_transaction_status() that returns the backend transaction
status as libpq knows. Also added some symbolic constants to
psycopg.extensions module (TRANSACTION_STATUS_XXX).
2007-04-14 Federico Di Gregorio <[email protected]>
* psycopg/psycopg.h: fixed probable typo in definition of
CONV_CODE_PY_SSIZE_T: d -> i for Python < 2.5.
* Fixed some of the examples.
2007-04-13 Federico Di Gregorio <[email protected]>
* Applied slighly modified patch from daniel (#176). Made
buffer size a compile-time parameter.
* Applied patch from David Rushby: typecast_binary.c cleanup.
* Applied patch from David Rushby for int->size_t transition.
2007-04-12 Federico Di Gregorio <[email protected]>
* Applied patch from Jason Erickson to fix win32 build glitches.
2007-04-11 Federico Di Gregorio <[email protected]>
* Release 2.0.6b2.
* psycopg/cursor_type.c: added check to raise an error when
some crazy programmer tries to use different argument formats
in the same query string. Fixes #162.
* Applied patch from David Rushby to fix win32 builds.
2007-04-10 Federico Di Gregorio <[email protected]>
* Applied patch from David Rushby to fix mem and ref leaks in
psycopg2.connect().
* Applied super-patch from David Rushby to fix Python 2.5 and 64
bit problems (all of them, kudos!)
2007-02-22 Federico Di Gregorio <[email protected]>
* Added support for per-connection and per-cursor typecasters.
2007-02-11 Federico Di Gregorio <[email protected]>
* psycopg/pqpath.c: ported psycopg1 patch from #135.
* psycopg/connection_type.c: now the password is obfuscated after we try
to connect to the backend. This really fixes #147.
2007-01-20 Federico Di Gregorio <[email protected]>
* Release 2.0.6b1.
* Added encodings patch from Karsten Hilbert.
2007-01-19 Federico Di Gregorio <[email protected]>
* psycopg/adapt_list.c: added support for None. And this closes
the other half.
* psycopg/typecast_array.c: added support for detecting the NULL
special string and converting it as a real NULL if not enclosed in
quotes. This closes half of #154.
2007-01-16 Federico Di Gregorio <[email protected]>
* psycopg/connection_type.c: .set_client_encoding() now converts the
argument to upper case to make sure it has the same case of the entries
in the PostgreSQL -> Python encoding conversion table.
* lib/extras.py: merged DictCursor from #143 and renamed it
RealDictCursor because allows access by cursor keys _only_.
Also cleaned up a little bit the implementation of both DictCursor
and RealDictCursor by introducing DictCursorBase.
* psycopg/pqpath.cs: new checks for NULL values (meaning an
exception was raised) in all method calls (fixes #134).
* psycopg/psycopgmodule.c: applied LATIN patch from #148.
* psycopg/connection_type.c: obfuscate password after using it.
* lib/extras.py: moved SQL_IN to extensions.py; we're now officially
adapting tuples.
* psycopg/adapt_mxdatetime.c: fixed #137 by accessing the 'date' and
'time' attributes of the mx.DateTime instance: they are always in ISO
format.
* psycopg/typecast_datetime.c: fixed problem with year > 9999.
2006-10-29 Federico Di Gregorio <[email protected]>
* Applied patch from Jason Erickson to make psycopg build
again on win32 (closes: #132).
2006-09-30 Federico Di Gregorio <[email protected]>
* ZpsycopgDA/DA.py: applied the infinity patch from 1.1 (fixes #122).
* psycopg/adapter_datetime.py: fixed conversion problem with seconds
in the (59,60) range (fixes #131).
* ZpsycopgDA/DA.py: we now split on GMT+, GMT-, + or -. This should
fix bug #129.
* psycopg/adapter_datetime.py: now TimeFromTicks and
TimestampFromTicks both accept fractionary seconds (fixes #130).
2006-09-23 Federico Di Gregorio <[email protected]>
* lib/errorcodes.py: added list of all PostgreSQL error codes
compiled by Johan Dahlin.
* psycopg/psycopg.h: applied compatibility macros from PEP 353.
* Applied patch 1/3 from Piet Delport; from his email:
psycopg2-Py_ssize_t-input.diff adjusts variables used for parameters
and return values. These changes only prevent overflowing on values
greater than 32-bits, so they're not as critical as the other two
patches. I tried to leave places unchanged where the input size is
already constrained to sizeof(int), but i might have missed a few
either way, not being too familiar with the codebase.