Re: Leap second impact on postgreSQL on June 30 2015

From: Vick Khera <vivek(at)khera(dot)org>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Leap second impact on postgreSQL on June 30 2015
Date: 2015-02-24 13:35:44
Message-ID: CALd+dcdghkBSUte8O=10LtVc0f-L8TFGvAd6incaSu0TcqeO8g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Feb 24, 2015 at 2:15 AM, Mitu Verma <mitu(dot)verma(at)ericsson(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sergey Shchukin 2015-02-24 13:42:06 Issue with a hanging apply process on the replica db after vacuum works on primary
Previous Message Guillaume Drolet 2015-02-24 13:06:22 Re: Sequences not moved to new tablespace