Thread: Leap second impact on postgreSQL on June 30 2015

Leap second impact on postgreSQL on June 30 2015

From
Mitu Verma
Date:

What could be the possible impacts of leap second on June 30 2105 (which will make the one second longer time) at PostgreSQL database ?

 

Regards

 

Re: Leap second impact on postgreSQL on June 30 2015

From
Vick Khera
Date:

On Tue, Feb 24, 2015 at 2:15 AM, Mitu Verma <mitu.verma@ericsson.com> wrote:

What could be the possible impacts of leap second on June 30 2105 (which will make the one second longer time) at PostgreSQL database ?


As an experiment, try setting the time to the leap second and see if postgres stores it as you expect. Ie, set your time to "June 30, 2015 23:59:60 UTC".

On 9.4.1 it is not looking like it knows that second exists.

postgres=> select version();
-[ RECORD 1 ]--------------------------------------------------------------------------------------------------------
version | PostgreSQL 9.4.1 on amd64-portbld-freebsd9.3, compiled by cc (GCC) 4.2.1 20070831 patched [FreeBSD], 64-bit

Time: 163.817 ms
postgres=> select 'June 30, 2015 23:59:59 UTC'::timestamptz;
      timestamptz
------------------------
 2015-06-30 19:59:59-04
(1 row)

Time: 22.110 ms
postgres=> select 'June 30, 2015 23:59:60 UTC'::timestamptz;
      timestamptz
------------------------
 2015-06-30 20:00:00-04
(1 row)

Time: 0.643 ms
postgres=> select 'July 1, 2015 00:00:00 UTC'::timestamptz;
      timestamptz
------------------------
 2015-06-30 20:00:00-04
(1 row)

Time: 0.731 ms
postgres=> set timezone='UTC';
SET
Time: 17.630 ms
postgres=> select 'July 1, 2015 00:00:00 UTC'::timestamptz;
      timestamptz
------------------------
 2015-07-01 00:00:00+00
(1 row)

Time: 0.661 ms
postgres=> select 'June 30, 2015 23:59:60 UTC'::timestamptz;
      timestamptz
------------------------
 2015-07-01 00:00:00+00
(1 row)

Time: 0.726 ms
postgres=> select 'June 30, 2015 23:59:59 UTC'::timestamptz;
      timestamptz
------------------------
 2015-06-30 23:59:59+00
(1 row)

Time: 0.698 ms