You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafodion.apache.org by "Liu, Yuan (Yuan)" <yu...@esgyn.cn> on 2018/03/09 10:24:46 UTC

Trafodion systimestamp and current_timestamp

Hi trafodioneers,

It happened that I found Trafodion support both systimestamp and current_timestmap, though systimestamp is not documented in official SQL manual document.

I'd like to make sure is that true that systimestamp represents server timestamp and current_timestamp represents client timestamp?

>>select systimestamp from dual;

(EXPR)
--------------------------

2018-03-09 18:17:58.534957

--- 1 row(s) selected.
>>
>>
>>select current_timestamp from dual;

(EXPR)
--------------------------

2018-03-09 18:18:18.844576

--- 1 row(s) selected.



Oracle has such documentation as below,
SYSTIMESTAMP returns current timestamp on database server, while current_timestamp returns current timestamp on client machine. So if your database server is in New York and client box is in California, SYSTIMESTAMP will be 3 hours ahead of CURRENT_TIMESTAMP.


Best regards,
Yuan


RE: Trafodion systimestamp and current_timestamp

Posted by "Liu, Yuan (Yuan)" <yu...@esgyn.cn>.
Thank you Anoop and LiuMing.



Best regards,
Yuan

-----Original Message-----
From: Anoop Sharma <an...@esgyn.com> 
Sent: Friday, March 09, 2018 11:27 PM
To: dev@trafodion.apache.org
Subject: RE: Trafodion systimestamp and current_timestamp

yes, that is correct. All times are returned as local time of the system where the master executor (mxosrvr) is running. 

One can also use current_timestamp_utc to return the UTC/GMT equivalent value of current time.

If mxosrvr is running in CA and that system's clock is set to represent local time, then current_timestamp will return 2018-03-09 10:00:00  (assuming the query was issued at 10 am local time) and current_timestamp_utc will return 2018-03-09 18:00:00  (CA is 8 hours behind gmt).

anoop


-----Original Message-----
From: Liu, Ming (Ming) <mi...@esgyn.cn>
Sent: Friday, March 9, 2018 6:53 AM
To: dev@trafodion.apache.org
Subject: RE: Trafodion systimestamp and current_timestamp

Hi,

In Trafodion, current_timestamp is the time on database server. 
And from the parser rules, I found systimestamp is synonym of current_timestamp. So they are identical in Trafodion.

IMHO: If people want client timestamp, it should be implemented in the driver I think, which application can also get via calling gettimeofday() in C/C++ or from system package in java. So I don't think there is a strong requirement for this?

Thanks,
Ming

-----Original Message-----
From: Liu, Yuan (Yuan) <yu...@esgyn.cn>
Sent: Friday, March 09, 2018 6:25 PM
To: dev@trafodion.apache.org
Subject: Trafodion systimestamp and current_timestamp

Hi trafodioneers,

It happened that I found Trafodion support both systimestamp and current_timestmap, though systimestamp is not documented in official SQL manual document.

I'd like to make sure is that true that systimestamp represents server timestamp and current_timestamp represents client timestamp?

>>select systimestamp from dual;

(EXPR)
--------------------------

2018-03-09 18:17:58.534957

--- 1 row(s) selected.
>>
>>
>>select current_timestamp from dual;

(EXPR)
--------------------------

2018-03-09 18:18:18.844576

--- 1 row(s) selected.



Oracle has such documentation as below,
SYSTIMESTAMP returns current timestamp on database server, while current_timestamp returns current timestamp on client machine. So if your database server is in New York and client box is in California, SYSTIMESTAMP will be 3 hours ahead of CURRENT_TIMESTAMP.


Best regards,
Yuan


RE: Trafodion systimestamp and current_timestamp

Posted by Anoop Sharma <an...@esgyn.com>.
yes, that is correct. All times are returned as local time of the system where
the master executor (mxosrvr) is running. 

One can also use current_timestamp_utc to return the UTC/GMT equivalent
value of current time.

If mxosrvr is running in CA and that system's clock is set to represent local
time, then current_timestamp will return 2018-03-09 10:00:00  (assuming
the query was issued at 10 am local time) and current_timestamp_utc will
return 2018-03-09 18:00:00  (CA is 8 hours behind gmt).

anoop


-----Original Message-----
From: Liu, Ming (Ming) <mi...@esgyn.cn> 
Sent: Friday, March 9, 2018 6:53 AM
To: dev@trafodion.apache.org
Subject: RE: Trafodion systimestamp and current_timestamp

Hi,

In Trafodion, current_timestamp is the time on database server. 
And from the parser rules, I found systimestamp is synonym of current_timestamp. So they are identical in Trafodion.

IMHO: If people want client timestamp, it should be implemented in the driver I think, which application can also get via calling gettimeofday() in C/C++ or from system package in java. So I don't think there is a strong requirement for this?

Thanks,
Ming

-----Original Message-----
From: Liu, Yuan (Yuan) <yu...@esgyn.cn> 
Sent: Friday, March 09, 2018 6:25 PM
To: dev@trafodion.apache.org
Subject: Trafodion systimestamp and current_timestamp

Hi trafodioneers,

It happened that I found Trafodion support both systimestamp and current_timestmap, though systimestamp is not documented in official SQL manual document.

I'd like to make sure is that true that systimestamp represents server timestamp and current_timestamp represents client timestamp?

>>select systimestamp from dual;

(EXPR)
--------------------------

2018-03-09 18:17:58.534957

--- 1 row(s) selected.
>>
>>
>>select current_timestamp from dual;

(EXPR)
--------------------------

2018-03-09 18:18:18.844576

--- 1 row(s) selected.



Oracle has such documentation as below,
SYSTIMESTAMP returns current timestamp on database server, while current_timestamp returns current timestamp on client machine. So if your database server is in New York and client box is in California, SYSTIMESTAMP will be 3 hours ahead of CURRENT_TIMESTAMP.


Best regards,
Yuan


RE: Trafodion systimestamp and current_timestamp

Posted by "Liu, Ming (Ming)" <mi...@esgyn.cn>.
Hi,

In Trafodion, current_timestamp is the time on database server. 
And from the parser rules, I found systimestamp is synonym of current_timestamp. So they are identical in Trafodion.

IMHO: If people want client timestamp, it should be implemented in the driver I think, which application can also get via calling gettimeofday() in C/C++ or from system package in java. So I don't think there is a strong requirement for this?

Thanks,
Ming

-----Original Message-----
From: Liu, Yuan (Yuan) <yu...@esgyn.cn> 
Sent: Friday, March 09, 2018 6:25 PM
To: dev@trafodion.apache.org
Subject: Trafodion systimestamp and current_timestamp

Hi trafodioneers,

It happened that I found Trafodion support both systimestamp and current_timestmap, though systimestamp is not documented in official SQL manual document.

I'd like to make sure is that true that systimestamp represents server timestamp and current_timestamp represents client timestamp?

>>select systimestamp from dual;

(EXPR)
--------------------------

2018-03-09 18:17:58.534957

--- 1 row(s) selected.
>>
>>
>>select current_timestamp from dual;

(EXPR)
--------------------------

2018-03-09 18:18:18.844576

--- 1 row(s) selected.



Oracle has such documentation as below,
SYSTIMESTAMP returns current timestamp on database server, while current_timestamp returns current timestamp on client machine. So if your database server is in New York and client box is in California, SYSTIMESTAMP will be 3 hours ahead of CURRENT_TIMESTAMP.


Best regards,
Yuan