Re: sslinfo extension - add notbefore and notafter timestamps - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: sslinfo extension - add notbefore and notafter timestamps
Date
Msg-id 8770B249-4164-44B3-8D04-5576FEB4196F@yesql.se
Whole thread Raw
In response to Re: sslinfo extension - add notbefore and notafter timestamps  (Cary Huang <cary.huang@highgo.ca>)
Responses Re: sslinfo extension - add notbefore and notafter timestamps
List pgsql-hackers
> On 20 Mar 2024, at 00:24, Cary Huang <cary.huang@highgo.ca> wrote:

> but it seems to me that many of the timestamp related functions still consider
> timestamp or timestampTz as "double values with units of seconds" though.

The issue here is that postgres use a different epoch from the unix epoch, so
any dates calcuated based on the unix epoch need to be adjusted.  I've hacked
this up in the attached v11 using overflow-safe integer mul/add as proposed by
Jacob upthread (we really shouldn't risk overflowing an int64 here but there is
no harm in using belts and suspenders here as a defensive measure).

The attached v11 is what I propose we go ahead with unless there further
comments on this.

--
Daniel Gustafsson


Attachment

pgsql-hackers by date:

Previous
From: Alexander Lakhin
Date:
Subject: Re: Test 031_recovery_conflict.pl is not immune to autovacuum
Next
From: Peter Eisentraut
Date:
Subject: Re: Improve readability by using designated initializers when possible