Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tcWGC-000gHN-3Y for pgsql-general@arkaria.postgresql.org; Mon, 27 Jan 2025 21:03:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tcWFC-00EfD3-JO for pgsql-general@arkaria.postgresql.org; Mon, 27 Jan 2025 21:02:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tcWFC-00EfCu-9x for pgsql-general@lists.postgresql.org; Mon, 27 Jan 2025 21:02:06 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tcWF8-001qZ7-2Y for pgsql-general@postgresql.org; Mon, 27 Jan 2025 21:02:05 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-436281c8a38so34598775e9.3 for ; Mon, 27 Jan 2025 13:02:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738011721; x=1738616521; darn=postgresql.org; h=content-transfer-encoding:subject:to:content-language:user-agent :mime-version:date:message-id:from:from:to:cc:subject:date :message-id:reply-to; bh=VXfUbmObZqo0k1IUF69HKKmrO4BMyRClXSkmWFF1ulA=; b=Lt+GYXM8sDP6/PJU8ffje5pTJ2Ru1WgxZcjDpUMxPPkIgcSjc/TyELKo3L6VqvP/rA BDeYLVQKdXtYZaENSLiTVc5XjjYKzVkNlrYvBmmc5oLetZ4sjm+eMWeHp9m2d634tF7l Ki8CSPzxViBzzgvWgmsryIkAH2NYHz9ovFAQu1KPWpdofQCZr0NJbCRRvHzRVmAzLJjY 6EmggnU8Q1a7P4C2YrXYhDgGZtkA6WTtJPfjXndWe2PX/vg09jvcB0YXQCFGvzRRBTQV 7SsMKcFJBimbZNRjvMH+oZ28zBSbCcEwdx6ZEae4dklS7QWdMJe7SZAczAQojMARVEIV WbgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738011721; x=1738616521; h=content-transfer-encoding:subject:to:content-language:user-agent :mime-version:date:message-id:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VXfUbmObZqo0k1IUF69HKKmrO4BMyRClXSkmWFF1ulA=; b=TnlRo/R8qVwZy9xEGkRqGmlNZyE3a61maKToAMOOacMecmRdSwFqizqJHdzGiYMART XQwwgL39KEr5YFQXcfS2pOz4TngsUabjpWRNJnaq9HwOsuKd0o974f8tXe2xKKR8gmR1 EEPCWMzJr1+UPs1dtpiI6Vd5Vn05pnZi8xyvWXZH7epjudHfOLTeMvJew9fQ1rlPdU2O 6cUWojkkqxgq+zACn4YUjaer6wg9rioVRT8+nilKjiIykRfK84oBBBRQQm1AiDJcSIfi Xu4HulyVtFNYWI5Cv5c+IVodKKcaeShm/KnZZZ3R7R2k9mz2PCQM+4ZIR+kpUj6+h45L t/tA== X-Gm-Message-State: AOJu0YzxE1Y7YwZF2ksNminU7Agmsrm4rOUnMwR9mXpntoFNzfFF6MBg 4hMX4qvqHTSPjI11QOARX1dJjWUxanWl5sBSnxmAym5km1/2Cd6jUYcx5AOvYVTvFg== X-Gm-Gg: ASbGncti3LCBegmYTjTajFDs/vt/FRFoJnmrHUaePQXKmfuL4Y55jxivHtisoMqAT4Q tpkMYLwiDVNIhiDCS4FYfpMijE1YfegD95B/pjg+Uw4n1hzt0f2OXFBzMeUlZGuQ6JDqVhqD2P3 VUlw9AhZRD/J7Z/tVJaa+Pyv3Na9G4XmVAhCucVMBpTJWRGDXHjwXQoAVWU0Y+10KXztP8GhRY3 Fmse/a3o4x7LZ+8+9056YBZ83Vxw0+ZbCYV11pzkzOYD43mEQZKMyYt9aVVJFXI+LL7FQw6SPUg oLVbgS5Np5XP08AAfs/UTLPva4S5uR9MEnzE7gbNgAziUPGEijU3qeY4KkcOGb43LAoE X-Google-Smtp-Source: AGHT+IE8U93mROpYfNCnKOt+bVmgUB6idvG3ONrtE2QIb4NtDXdETy1Uebcms9PfSoaBnlwvK39JHA== X-Received: by 2002:a05:600c:1f82:b0:436:fbe0:cebe with SMTP id 5b1f17b1804b1-43891452f6emr434636665e9.30.1738011720588; Mon, 27 Jan 2025 13:02:00 -0800 (PST) Received: from [192.168.171.75] (33C7E011.skybroadband.com. [51.199.224.17]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd4d2a82sm143667565e9.36.2025.01.27.13.02.00 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Jan 2025 13:02:00 -0800 (PST) From: Nem Tudom X-Google-Original-From: Nem Tudom Message-ID: Date: Mon, 27 Jan 2025 21:01:59 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: pgsql-general Subject: Issues with EPOCH-s, TIMESTAMP(TZ)-s and leap seconds. Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi all, I'm having trouble understanding matters related to TIMESTAMP(TZ)-s and leap seconds - my machine runs on UTC so as to remove any issues related to the zones. From here: https://en.wikipedia.org/wiki/Leap_second, There have been 27 leap seconds added to UTC since 1972. But, when I run this fiddle (see bottom of this email link) https://dbfiddle.uk/wxvmzfJb (first snippet - 2015 -> 2016) I get a "nice" even number for the EPOCH of, 00:00:00 2016 , say (= 1451606400) - now, with 27 leap seconds since 1972, I would expect that number to be (something like) 1451606427? I thought that the EPOCH was the number of seconds since 1970-01-01 00:00:00? Is this incorrect? Also, (first snippet again), why is the TIMESTAMPTZ 23:59:60 2015 even allowed? Now, we come to the second snippet (2016 -> 2017), I get *_exactly_* the same behaviour! I was expecting to see that '2016-12-31 23:59:60'::TIMESTAMPTZ would work (leap second) and then that '2017-01-01 00:00:00'::TIMESTAMPTZ would have incremented by 1 second? I'm puzzled. Does PostgreSQL take leap seconds into account? Does anyone? Any help, advice, recommendations, URL-s, references &c. appreciated. E...