db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Hillegas (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-6834) support for CURRENT_TIMESTAMP(precision) appears to be missing
Date Fri, 11 Sep 2015 02:39:45 GMT

    [ https://issues.apache.org/jira/browse/DERBY-6834?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14740051#comment-14740051
] 

Rick Hillegas commented on DERBY-6834:
--------------------------------------

The syntax for CURRENT_TIMESTAMP() is defined in the 2011 SQL Standard, part 2, section 6.32
(datetime value function):

{noformat}
CURRENT_TIMESTAMP[ left_paren timestampPrecision right_paren ]

where timestampPrecision is an unsigned integer, the number of
decimal digits which follow the decimal point.
{noformat}

Right now, a Derby TIMESTAMP value is a java.sql.Timestamp, whose precision is nanoseconds.
But the precision for CURRENT_TIMESTAMP() is actually coarser because Derby calculates the
current time using System.currentTimeMillis(). The precision could be increased to nanoseconds
if Derby called System.nanoTime() instead. I would be interested in suggestions about how
a pure Java application like Derby could get the current time at a greater precision than
nanoseconds. Thanks.


> support for CURRENT_TIMESTAMP(precision) appears to be missing
> --------------------------------------------------------------
>
>                 Key: DERBY-6834
>                 URL: https://issues.apache.org/jira/browse/DERBY-6834
>             Project: Derby
>          Issue Type: Improvement
>            Reporter: Julian Reschke
>
> See <http://savage.net.au/SQL/sql-92.bnf.html#current%20timestamp%20value%20function>,
<http://www.h2database.com/html/functions.html#current_timestamp>, <http://www.postgresql.org/docs/8.2/static/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT>



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message