Re: sslinfo extension - add notbefore and notafter timestamps

Поиск
Список
Период
Сортировка
От Daniel Gustafsson
Тема Re: sslinfo extension - add notbefore and notafter timestamps
Дата
Msg-id 8770B249-4164-44B3-8D04-5576FEB4196F@yesql.se
обсуждение исходный текст
Ответ на Re: sslinfo extension - add notbefore and notafter timestamps  (Cary Huang <cary.huang@highgo.ca>)
Ответы Re: sslinfo extension - add notbefore and notafter timestamps  (Jacob Champion <jacob.champion@enterprisedb.com>)
Список 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


Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alexander Lakhin
Дата:
Сообщение: Re: Test 031_recovery_conflict.pl is not immune to autovacuum
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Improve readability by using designated initializers when possible