Pivotal Knowledge Base

Follow

Behavior of Leap Second in Greenplum Database

Environment

 Product  Version
 Pivotal Greenplum  4.3.x
 DCA  X

Purpose

This article explains the behavior of leap second in Greenplum. 

Greenplum relies on the timezone settings (TZ) in the operating system. This TZ database does not store leap seconds. Also, Greenplum considers 60th second as the 0th second of the consecutive minute.

Description

The following is an example to explain this behavior:

kamal=# insert into test_123 values (1,'2016-11-30 23:57:60.000001');
INSERT 0 1
kamal=# insert into test_123 values (2,'2016-11-30 23:57:60.900001');
INSERT 0 1
kamal=# SELECT * from test_123;
 id |            time
----+----------------------------
  1 | 2016-11-30 23:58:00.000001
  2 | 2016-11-30 23:58:00.900001

(2 rows)



As you can see, Greenplum considers the 60th second as the 0th second of the consecutive minute.

Here's the successive output of select now() with journey between 59th second and 0th second of next minute:

Select now() output between 23:56:59 and 23:57:00

        now
-------------------------------
 2016-11-30 23:56:59.997138-08

              now
-------------------------------
 2016-11-30 23:56:59.998102-08

             now
------------------------------
 2016-11-30 23:56:59.99915-08

              now
-------------------------------
 2016-11-30 23:57:00.000201-08

             now
------------------------------
 2016-11-30 23:57:00.00128-08

Also, this leap year adjustment is related to the time and date of the hardware system and has no impact on the software.

 

Comments

Powered by Zendesk