Re: Fix comments in instr_time.h and remove an unneeded cast to int64 - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Fix comments in instr_time.h and remove an unneeded cast to int64
Date
Msg-id 22385e4d-19b7-46e6-a969-52eb68624ca0@iki.fi
Whole thread Raw
In response to Re: Fix comments in instr_time.h and remove an unneeded cast to int64  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Fix comments in instr_time.h and remove an unneeded cast to int64
Re: Fix comments in instr_time.h and remove an unneeded cast to int64
List pgsql-hackers
On 06/08/2024 17:20, Tom Lane wrote:
> Heikki Linnakangas <hlinnaka@iki.fi> writes:
>> On 06/08/2024 11:54, Bertrand Drouvot wrote:
>>> Please find attached a tiny patch to correct those and, in passing, remove what
>>> I think is an unneeded cast to int64.
> 
>> Applied, thanks!
> 
> I think this comment change is a dis-improvement.  It's removed the
> documentation of the important fact that INSTR_TIME_GET_MICROSEC and
> INSTR_TIME_GET_NANOSEC return a different data type from
> INSTR_TIME_GET_MILLISEC (ie, integer versus float).  Also, the
> expectation is that users of these APIs do not know the actual data
> type of instr_time, and instead we tell them what the output of those
> macros is.  This patch just blew a hole in that abstraction.

Hmm, ok I see. Then I propose:

1. Revert
2. Just fix the comment to say int64 instead of uint64.

-- 
Heikki Linnakangas
Neon (https://neon.tech)

Attachment

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Support multi-column renaming?
Next
From: jian he
Date:
Subject: Re: SQL:2011 application time