forked from Instagram/psycopg2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ChangeLog
2455 lines (1558 loc) · 80.2 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-12-18 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* connection.h: added codec attribute to avoid repeated codec name
lookups during unicode query/params manipulations.
* setup.py: bumped to version 2.3.2.dev0
* psycopg/connection_int.c: applied patch from Marti Raudsepp to close
ticket #24. Fixed segfault in connection when DateStyle not available
(e.g. pgbouncer appars not passing it to the client)
2010-12-15 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* psycopg/utils.c: Added psycopg_strdup function.
2010-12-14 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* psycopg/connection_type.c: No need to put connection fields to zero.
* lib/extensions.py: Improved mapping from PG to Py encodings.
* psycopg/psycopgmodule.c: Added a few missing encodings: EUC_CN,
EUC_JIS_2004, ISO885910, ISO885916, LATIN10, SHIFT_JIS_2004.
2010-12-04 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* setup.py: bumped to version 2.3.1.dev0
* datetime modules reorganized to work around CentOS 5.5 x86_64 buld
problem. Closes ticket #23
* psycopg/typecast.h: dropped private functions interfaces.
2010-12-01 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* lib/extras.py: DictRow items can be updated. Patch by Alex Aster.
2010-11-28 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* Cancel patch from Jan integrated.
* psycopg/connection_type.c: can't cancel a prepared connection
2010-11-22 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* psycopg/connection_int.c: dropped notices hack to get COPY errors from
V2 protocol.
2010-11-18 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* psycopg/connection.h: Added enum with possilbe isolation level states.
Also, general isolation levels cleanup and tests added.
* psycopg/utils.c: compiler warning dropped.
* typecast.h: functions exported to drop warnings.
* datetime module initialized at is supposed to be.
* mx.DateTime module initialized at is supposed to be.
2010-11-17 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* psycopg/connection_type.c: don't clobber exception if
isolation_level_switch fails.
2010-11-16 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* psycopg/connection_int.c: abort connection to protocol 2 server.
* psycopg/pqpath.c
* psycopg/connection_int.c: dropped support for protocol 2 at compile
time and protocol 2-specific code.
* psycopg/connection_int.c: don't run a query at every connection to detect
client encoding: use PQparameterStatus() instead.
* psycopg/connection_int.c: don't run a query at every connection to set
the datestyle to ISO if PQparameterStatus() reports it already is.
2010-11-11 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* lib/extras.py: build the namedtuple only once per execution, not once
per fetch.
* lib/extras.py: don't change the exception raised when fetching without a
result from NamedTupleCursor.
* psycopg/connection_int.c: fixed notices order (ticket #9).
2010-11-10 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* psycopg/green.c: functions unused outside the module marked static.
2010-11-09 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* Replaced PyObject_CallFunction() with *ObjArgs() where more efficient.
* Dropped PyArg_ParseTuple() calls in functions taking no arguments.
* psycopg/microprotocols.c: small optimizations.
* Avoid pointless string manipulation in NamedTupleCursor (ticket #10)
* psycopg/microprotocols.c: Check the presence of a mro.
2010-11-08 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* psycopg/microprotocols.c: use faster function to build tuples.
* psycopg/microprotocols.c: fixed refcount bug.
* psycopg/microprotocols.c: use the adapter of an object superclass if
available.
* psycopg/adapter_pdecimal.c: fixed crash in pdecimal_str with Python
2.5.x releases in which is_finite() is not available.
2010-11-06 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* lib/extras.py: added NamedTupleCursor.
2010-11-05 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* setup.py: bumped to version 2.3.dev0
* merged dev branches for 2 phase commit, notify payload, hstore adapter
2010-10-22 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* MANIFEST.in: Dropped reference to removed TODO file: it breaks 'pip'.
2010-10-08 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* psycopg/typecast_binary.c: use PQfreemem to free memory allocated by
the libpq. Bug reported by Anton Kovalev.
* dropped PSYCOPG_OWN_QUOTING.
* psycopg/connection_int.c: Fixed access to freed memory in
conn_get_isolation_level(). Bug reported by Anton Kovalev.
2010-10-06 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* Merged James Henstridge work on two-phase commit support.
2008-07-24 James Henstridge <james@jamesh.id.au>
* tests/test_psycopg2_dbapi20.py (Psycopg2TPCTests): hook up two
phase commit tests.
* psycopg/xid_type.c (xid_len, xid_getitem): implement sequence
behaviour, as required for transaction IDs.
(XidType): There is no point in allowing subclasses of Xid.
2008-07-23 James Henstridge <james@jamesh.id.au>
* psycopg/connection_type.c (psyco_conn_xid): add a
Connection.xid() method that instantiates Xid objects.
* psycopg/psycopgmodule.c (init_psycopg): initialise the Xid
object type.
* psycopg/xid.h:
* psycopg/xid_type.c: Implement a basic transaction ID object for
use in two phase commit.
2008-05-12 James Henstridge <james@jamesh.id.au>
* beginnings of a TPC test harness
2010-10-05 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* psycopg/cursor_type.c: Common code in execute() and mogrify() merged.
* psycopg/cursor_type.c: cursor.mogrify() accepts unicode queries.
2010-09-23 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* lib/errorcodes.py: Added PostgreSQL 9.0 error codes.
2010-08-05 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* psycopg/connection_int.c: don't execute a ROLLBACK on close()/GC.
The command wasn't sent since 2.2.0 due to a bug, but after a ML
discussion this behaviour proved more correct so the bug has become a
feature.
2010-07-18 Federico Di Gregorio <fog@initd.org>
* Release 2.2.2.
2010-07-09 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* psycopg/cursor_type.c: executemany() propagates exceptions raised by the
iterable to the caller.
* lib/pool.py: dropped logging.basicConfig() call. It messes up with
projects using logging but where no handler is installed on the root
logger. Bug reported by Joe Abbate.
* psycopg/cursor_type.c: exceptions raised in the columns iterator of the
copy methods propagated to the caller.
2010-05-20 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* psycopg/typecast_datetime.c: Round seconds in historical timezones to
the nearest minute.
* lib/extras.py: register_tstz_w_secs() is now no-op.
2010-05-17 Federico Di Gregorio <fog@initd.org>
* Release 2.2.1.
* Builds again on Windows.
2010-05-16 Federico Di Gregorio <fog@initd.org>
* Release 2.2.0.
2010-05-15 Federico Di Gregorio <fog@initd.org>
* typecast.c: Fixed problem related to receiving None from Python
when a string was expected.
2010-05-07 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* 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 <daniele.varrazzo@gmail.com>
* 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 <daniele.varrazzo@gmail.com>
* 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 <daniele.varrazzo@gmail.com>
* lib/pqpath.c: Fixed reference leak in notify reception.
* Notifies are collected if available after every query execution.
2010-04-13 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* lib/extensions.py: DECIMAL typecaster imported from _psycopg.
* lib/extensions.py: PY* and MX* time typecaster imported from _psycopg.
2010-04-11 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* psycopg/connection_type.c: Correctly parse keywords in connect().
2010-04-07 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* 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 <fog@initd.org>
* Fixed problem with asynchronous NOTIFYs.
* Integrated async pacthes from Jan's git tree.
2010-03-13 Federico Di Gregorio <fog@initd.org>
* Release 2.0.14.
2010-03-11 Federico Di Gregorio <fog@initd.org>
* setup.py: one-liner from Devrim GÜNDÜZ to build with PostgreSQL
alpha.
2010-02-28 Federico Di Gregorio <fog@initd.org>
* 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 <fog@initd.org>
* Added new Decimal adapter that correctly converts NaN and infinity
to PostgreSQL NaN numeric values. Also added tests.
2010-02-15 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* lib/errorcodes.py: Updated to PostgreSQL 8.4; added lookup() function.
2010-02-12 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* 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 <fog@initd.org>
* 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 <fog@initd.org>
* License migration: psycopg2 is now LGPL3 + OpenSSL exception.
* TODO file was never updated so lets remove it.
2010-02-10 Federico Di Gregorio <fog@initd.org>
* lib/extras.py: fixed register_tstz_w_secs() error as reported by
Karsten Hilbert.
2009-11-25 Federico Di Gregorio <fog@initd.org>
* 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 <fog@initd.org>
* psycopg/adapter_pfloat.c: applied patch from Remy Blankto fix float
loss of precision.
2009-10-04 Federico Di Gregorio <fog@initd.org>
* 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 <fog@initd.org>
* 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 <fog@initd.org>
* Applied patch from Robert Munro to fix version check
in ZPsycopgDA.
2009-05-10 Federico Di Gregorio <fog@initd.org>
* 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 <fog@initd.org>
* setup.py: applied patch from Elvis Pranskevichus to make
PostgreSQL version detection more robust.
2009-04-20 Federico Di Gregorio <fog@initd.org>
* 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 <fog@initd.org>
* 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 <fog@initd.org>
* 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 <fog@initd.org>
* 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 <fog@initd.org>
* 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 <fog@initd.org>
* 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 <fog@initd.org>
* psycopg/config.h: added check to provide compatible isinf()
for Solaris (thanks to Jeremy Mason.)
2009-02-23 Federico Di Gregorio <fog@initd.org>
* Release 2.0.9.
2009-02-17 James Henstridge <james@jamesh.id.au>
* 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 <fog@initd.org>
* FreeBSD now has round(). Modified config.h as suggested by
Jeroen Ruigrok van der Werven.
2009-02-06 Federico Di Gregorio <fog@initd.org>
* 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 <fog@initd.org>
* 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 <fog@initd.org>
* Fixed problem reported by Lawrence Oluyede where
register_type() didn't work on connection and cursors
suclasses.
2009-01-10 Federico Di Gregorio <fog@initd.org>
* psycopg/cursor_type.c: cursor.isready() now raise an exception
when the libpq PQconsumeInput() call fails.
2008-12-04 Federico Di Gregorio <fog@initd.org>
* 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 <fog@initd.org>
* 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 <fog@initd.org>
* lib/extras.py: added inet support and related tests.
2008-09-23 James Henstridge <james@jamesh.id.au>
* psycopg/psycopg.h (NotSupportedError_doc): clean up
spelling/grammar a bit, using exception description from the PEP.
2008-09-23 Federico Di Gregorio <fog@initd.org>
* Applied patch from Brian Sutherland that fixes NULL
valus in UUID support.
2008-09-19 Federico Di Gregorio <fog@initd.org>
* lib/extras.py: added UUID support, modeled after the code
sent by Brian Sutherland.
2008-09-16 Federico Di Gregorio <fog@initd.org>
* Release 2.0.8.
2008-07-26 Federico Di Gregorio <fog@initd.org>
* psycopg/connection_type.c: merged get_backend_pid() method
by Casey Duncan.
2008-07-23 James Henstridge <james@jamesh.id.au>
* 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 <james@jamesh.id.au>
* 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 <james@jamesh.id.au>
* 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 <james@jamesh.id.au>
* 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 <fog@initd.org>
* setup.py: fixed problem with spaces in pg_config path.
2008-05-27 Federico Di Gregorio <fog@initd.org>
* 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 <fog@initd.org>
* psycopg/cursor_type.c: fixed memory leak in .executemany(); on
error "iter" was not dec'reffed.
2008-05-06 James Henstridge <james@jamesh.id.au>
* 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 <james@jamesh.id.au>
* psycopg/lobject.h: don't export the lobjectType symbol.
2008-05-05 Federico Di Gregorio <fog@initd.org>
* Fixed sun build problem by adding "sun" to config.h checks.
2008-05-05 James Henstridge <james@jamesh.id.au>
* 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 <fog@initd.org>
* 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 <james@jamesh.id.au>
* 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 <Jorgen.Austvik@sun.com>
* 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 <fog@initd.org>
* Release 2.0.7.
2008-03-31 James Henstridge <james@jamesh.id.au>
* 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 <james@jamesh.id.au>
* 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 <james@jamesh.id.au>
* psycopg/connection_int.c (conn_notice_callback): don't leak
notice messages.
2008-03-17 Federico Di Gregorio <fog@initd.org>
* 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 <james@jamesh.id.au>
* 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 <jerickso@stickpeople.com>
* 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 <james@jamesh.id.au>
* psycopg/pqpath.c (_pq_fetch_tuples): Don't call Python APIs
without holding the GIL.
2008-02-27 James Henstridge <james@jamesh.id.au>
* 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 <james@jamesh.id.au>
* 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 <james@jamesh.id.au>
* 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 <james@jamesh.id.au>
* 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 <james@jamesh.id.au>
* 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 <james@jamesh.id.au>
* 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 <james@jamesh.id.au>
* 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 <james@jamesh.id.au>
* 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 <james@jamesh.id.au>
* 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 <james@jamesh.id.au>
* 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 <james@jamesh.id.au>
* 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 <james@jamesh.id.au>
* 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 <james@jamesh.id.au>
* 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 <fog@initd.org>
* Applied win32 patch from Jason Erickson.
* Applied patch from Thomas Lotze to use correct version