summaryrefslogtreecommitdiff
path: root/psycopg/adapter_datetime.c
Commit message (Collapse)AuthorAgeFilesLines
* Avoid a possible null deref, tz might be NULL.Gabriel Kihlman2016-04-181-1/+1
| | | | Found by clang static analyzer.
* Cast time into timetz when the tzinfo field is set.Hyunjun Kim2014-11-131-1/+4
|
* Don't import psycopg2.tz into the C extensionDaniele Varrazzo2014-08-281-17/+23
| | | | | | | | | | | | | | | | | | | This makes possible to import _psycopg directly, after adding the package directory to the pythonpath. This enables hacks such as: sys.path.insert(0, '/path/to/psycopg2') import _psycopg sys.modules['psycopg2._psycopg'] = _psycopg sys.path.pop(0) which can work around e.g. the problem of #201, freeze that cannot freeze psycopg2. Well, freeze cannot freeze it because it's just not designed to deal with C extensions. At least now the frozen application can hack the pythonpath and work around the limitation by importing _psycopg as above and then doing the rest of the imports normally. Keeping long-lived references to python objects is bad anyway: the tz module couldn't be reloaded before.
* Dropped almost-no-op customized objects repr()Daniele Varrazzo2014-08-151-7/+1
| | | | | | | | The default repr is enough: it prints <TypeName at 0xADDR> instead of <TypeName object at 0xADDR>. The only people being hurt by this change are the ones using doctests: they deserve it.
* Dropped GC support for several objectsDaniele Varrazzo2013-04-051-11/+2
| | | | | | Non-containers don't need GC. It was half-baked anyway as the tp_clear was often not set. Dropped tp_traverse too for these objects as unused.
* PyType_GenericAlloc is the default allocator: no need to specifyDaniele Varrazzo2013-03-201-1/+1
|
* Dropped "customized" pg_free functionsDaniele Varrazzo2013-03-201-27/+1
| | | | The defaut is already to call PyObject_GC_Del.
* Raise an exception in case of failed localtime_r callDaniele Varrazzo2012-03-041-0/+11
|
* Merge branch 'python2' into python3Daniele Varrazzo2011-02-011-1/+1
|\
| * Hopefully really fixed crash in datetime adapter.Daniele Varrazzo2011-02-011-1/+1
| | | | | | | | Verified with gcc 4.3. Notice that on gcc 4.4 the bug was not present.
* | Merge branch 'python2' into python3Daniele Varrazzo2011-01-031-24/+24
|\ \ | |/ | | | | | | | | | | | | Conflicts: NEWS-2.3 psycopg/connection_type.c tests/test_connection.py tests/types_basic.py
| * Fixed "historical" reference leak in TimestampFromTicksDaniele Varrazzo2011-01-031-24/+24
| | | | | | | | | | | | | | Added an internal function with C signature to avoid the creation of a tuple to be later unpacked. When the tuple was decref'd, Python 2.4 64 bits regularly segfaulted; Python 2.5 less regularly; don't know about other versions.
* | Function psycopg_ensure_bytes converted in a "filter" stealing a ref.Daniele Varrazzo2010-12-311-9/+3
| |
* | Fixed adaptation in several adapters.Daniele Varrazzo2010-12-311-3/+3
| | | | | | | | | | The getquoted methods always return bytes. The str() convert this representation to string on the fly.
* | Use psycopg_ensure_bytes() to unify Py2/3 code paths.Daniele Varrazzo2010-12-311-51/+65
| |
* | Datetime adaptation in bytes.Daniele Varrazzo2010-12-311-11/+18
| |
* | The library can be compiled with Python 3.Daniele Varrazzo2010-12-211-6/+10
| | | | | | | | | | | | | | | | | | Just compiled! No test run yet and many points to review, marked in the code. The patch is largely Martin von Löwis work, simplified after refactoring in the previous commits and adapted to the new code (as the patch was originally for Psycopg 2.0.9)
* | Import structmember/stringobject headers from python.h.Daniele Varrazzo2010-12-211-2/+0
| | | | | | | | stringobject is not to be imported with Python 3.
* | Using PyVarObject_HEAD_INIT macro.Daniele Varrazzo2010-12-211-2/+1
| |
* | Using Py_TYPE and Py_REFCNT macros.Daniele Varrazzo2010-12-211-4/+4
| |
* | Changed Python const RO -> READONLY.Daniele Varrazzo2010-12-121-2/+2
| |
* | Internal imports simplified.Daniele Varrazzo2010-12-121-8/+6
|/ | | | | | | | | | .c files only need to import psycopg.h: it will in turn import dependencies from Python and libpq and configure.h. psycopg.h should be the first to be imported, so the basic imports are not required in the .h's As a guideline I'm trying to import from the most specific to the most generic to detect missing imports in the .h's.
* datetime module initialized as it is supposed to be.Daniele Varrazzo2010-11-191-18/+26
| | | | | Dropped compiler warnings. It wouldn't blow up if any api was called. No need to pass type pointers around.
* Dropped PyArg_ParseTuple() calls in functions taking no arguments.Daniele Varrazzo2010-11-091-2/+1
|
* Micrsoft Visual C Compile FixJason Erickson2010-05-171-2/+3
| | | | Moved the declarations of variables/pointers to the beginning of the block, where MSVC wants them.
* Fixed TimeFromTicks for second values > 59.5.Daniele Varrazzo2010-05-151-2/+2
|
* Fixed TimestampFromTicks for second values > 59.5.Daniele Varrazzo2010-05-151-1/+1
| | | | Bug reported and fixed by Jozsef Szalay on 2010-05-06 at 14:11:59.999920.
* Cast datetime into timestamptz when the tzinfo field is set.Daniele Varrazzo2010-05-151-1/+5
|
* Explicit cast of the SQL representation of time-related objects.Daniele Varrazzo2010-05-151-2/+17
| | | | | | | | Allow the objects to be recognized as the proper type by Postgres in not strong contexts: problem reported by Peter Eisentraut. Added tests to check the types are respected in a complete Py -> PG -> Py roundtrip without context.
* Changes license to LGPL3 + OpenSSL exception on all source filesFederico Di Gregorio2010-02-121-12/+16
|
* Use Py_CLEAR() in a few more places, and do INCREF's before setting James Henstridge2008-07-211-2/+2
| | | | struct members rather than afterwards.
* * psycopg/adapter_qstring.c (qstring_traverse): add cyclic GCJames Henstridge2008-07-181-3/+12
| | | | | | | | | | | | | 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.
* Preparing release 2.0.7.Federico Di Gregorio2008-04-141-3/+5
|
* Fixed test segfault due to double decref.Federico Di Gregorio2008-03-171-9/+10
|
* * Add HIDDEN attribute to datetime related global variables.James Henstridge2008-01-221-8/+8
| | | | | * Make const strings static, which essentially makes them labels for the strings.
* * psycopg/typecast_array.c (typecast_array_scan): set an initialJames Henstridge2008-01-131-2/+2
| | | | | | value for quotes to keep gcc happy. * psycopg/*.c: add missing static modifier on many functions.
* Aggressive threading on fetch (and a new bug!)Federico Di Gregorio2007-09-191-6/+5
|
* Fixed both Python 2.5 and 64 bit problems.Federico Di Gregorio2007-04-101-46/+51
|
* Fixed fractionary seconds >59 problem (closes: #131)Federico Di Gregorio2006-09-301-13/+15
|
* Fractionary seconds fix (closes: #130)Federico Di Gregorio2006-09-301-2/+6
|
* Interval conversion fix.Federico Di Gregorio2006-07-261-6/+5
|
* Code cleanup.Federico Di Gregorio2005-10-181-3/+4
|
* Default tzinfo_factory for cursors.Federico Di Gregorio2005-10-171-2/+2
|
* Working on TZ issues.Federico Di Gregorio2005-10-171-13/+30
|
* 1900 years shift fix.Federico Di Gregorio2005-07-211-2/+2
|
* TimestampFromTicks fix.Federico Di Gregorio2005-06-021-2/+2
|
* mingw patch from Daniele Varazzo.Federico Di Gregorio2005-04-101-1/+1
|
* Added __conform__ to all adapters (typos excluded.)Federico Di Gregorio2005-03-031-1/+1
|
* Added __conform__ to all adapters.Federico Di Gregorio2005-03-031-7/+12
|
* Adaptation fixes (a lot.)Federico Di Gregorio2005-02-281-2/+2
|