Re: sslinfo extension - add notbefore and notafter timestamps

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Cary Huang <cary(dot)huang(at)highgo(dot)ca>
Cc: Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: sslinfo extension - add notbefore and notafter timestamps
Date: 2024-03-20 14:03:45
Message-ID: 8770B249-4164-44B3-8D04-5576FEB4196F@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 20 Mar 2024, at 00:24, Cary Huang <cary(dot)huang(at)highgo(dot)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 Content-Type Size
v11-0001-Add-notBefore-and-notAfter-to-SSL-cert-info-disp.patch application/octet-stream 29.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2024-03-20 14:08:39 Re: Improve readability by using designated initializers when possible
Previous Message Alexander Lakhin 2024-03-20 14:00:00 Re: Test 031_recovery_conflict.pl is not immune to autovacuum