Re: Fix comments in instr_time.h and remove an unneeded cast to int64

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Fix comments in instr_time.h and remove an unneeded cast to int64
Date: 2024-08-06 14:57:28
Message-ID: ZrI52CUJXkpF9zHZ@ip-10-97-1-34.eu-west-3.compute.internal
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Tue, Aug 06, 2024 at 05:49:32PM +0300, Heikki Linnakangas wrote:
> On 06/08/2024 17:20, Tom Lane wrote:
> > Heikki Linnakangas <hlinnaka(at)iki(dot)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.

Oh ok, did not think about it that way, thanks for the feedback!

>
> Hmm, ok I see. Then I propose:
>
> 1. Revert
> 2. Just fix the comment to say int64 instead of uint64.

LGTM, thanks!

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2024-08-06 14:58:42 Re: Vacuum ERRORs out considering freezing dead tuples from before OldestXmin
Previous Message jian he 2024-08-06 14:50:00 Re: SQL:2011 application time