Subject Re: [firebird-support] milliseconds are not stored in the timestamp (KInterbasDB + Firebird)
Author Helen Borrie
At 06:29 AM 3/05/2006, you wrote:
>I am trying to insert "timestamp" to the Firebird database using
>standard library datetime module example given in the "KInterbasDB
>Usage Guide" http://tinyurl.com/mplo4 , section "Example Programs
>DATE/TIME/TIMESTAMP"
>
>Even timestamp has the correct format before inserting to the database
>(2006-26-2 17:25:34.940279 for example), milliseconds are not stored

Firebird stores subseconds to ten-thousandths of a second. If you
try to store >4 places of decimal, as here, you should get an
overflow exception. Possibly Python is silently handling such an
exception and passing something different to what you expect.

>and the database returns (2006,26,2,17,25,34).

The database doesn't return a structure like this. Probably you have
some Python function that is performing an EXTRACT query with
insufficient granularity to return subseconds, e.g. it is casting the
SECOND element as an integer. If EXTRACT (SECOND FROM
MyTimestampColumn) is allowed to return a decimal(9,4) you will get
the subseconds.

>I have made some Googling the whole afternoon to find if it is
>possible to configure Firebird or KInterbasDB, but no success.
>
>My environment: Fedora Core4, Firebird CS 1.5 (Dialect 3), Python 2.4.1,
>KInterbasDB 3.2b1

As this seems to be a Python thing, try subscribing to the
firebird-python list and inquiring there about it.

./heLen