Timestamp accuracy: milli-seconds or micro-seconds

Niels Nes Niels.Nes at cwi.nl
Fri Nov 7 16:16:06 CET 2014


On Fri, Nov 07, 2014 at 04:13:25PM +0100, Stefan Manegold wrote:
> Hi,
> 
> with the Oct2014 release of MonetDB
> (I did no (yet) check any other version),
> I just came across the following:
> 
> It appears that while timestamps are rendered with 6 decimal digits,
> i.e., suggesting micro-seconds accuracy/resolution,
> only milli-seconds are considered:
> 
> sql>select cast('1312-11-10 12:11:10.123456' as timestamp) , cast('1312-11-10 12:11:10' as timestamp) + 0.123456 , cast('1312-11-10 12:11:10' as timestamp) + interval '0.123456' second;
> +----------------------------+----------------------------+----------------------------+
> | L1                         | L2                         | sql_add_single_value       |
> +============================+============================+============================+
> | 1312-11-10 12:11:10.123000 | 1312-11-10 12:11:10.123000 | 1312-11-10 12:11:10.123000 |
> +----------------------------+----------------------------+----------------------------+
> 1 tuple (5.459ms)
> 
> Is this a bug or a "feature"?
Indeed a feature. The spec do require at least 6 digits redering
precision. Unfortunately our timestamp storage does not allow for that.

Niels
> 
> 
> Thanks!
> Stefan
> 
> -- 
> | Stefan.Manegold at CWI.nl | DB Architectures   (DA) |
> | www.CWI.nl/~manegold/  | Science Park 123 (L321) |
> | +31 (0)20 592-4212     | 1098 XG Amsterdam  (NL) |
> 
> _______________________________________________
> developers-list mailing list
> developers-list at monetdb.org
> https://www.monetdb.org/mailman/listinfo/developers-list

-- 
Niels Nes, Centrum Wiskunde & Informatica (CWI)
Science Park 123, 1098 XG Amsterdam, The Netherlands
room L3.14,  phone ++31 20 592-4098 	sip:4098 at sip.cwi.nl
url: http://www.cwi.nl/~niels   e-mail: Niels.Nes at cwi.nl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://www.monetdb.org/pipermail/developers-list/attachments/20141107/4b878658/attachment.sig>


More information about the developers-list mailing list