Re: [PATCH] Remove workarounds to format [u]int64's

From: Japin Li <japinli(at)hotmail(dot)com>
To: Aleksander Alekseev <aleksander(at)timescale(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH] Remove workarounds to format [u]int64's
Date: 2022-03-21 10:13:46
Message-ID: MEYP282MB16693D00579208E2C272CACAB6169@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Mon, 21 Mar 2022 at 17:23, Aleksander Alekseev <aleksander(at)timescale(dot)com> wrote:
> Hi Pavel,
>
>> Probably you can do (long long) instead of (long long int). It is shorter and this is used elsewhere in the code.
>
> Thanks! Here is the updated patch. I also added Reviewed-by: and
> Discussion: to the commit message.

Hi,

After apply the patch, I found pg_checksums.c also has the similar code.

In progress_report(), I'm not sure we can do this replace for this code.

snprintf(total_size_str, sizeof(total_size_str), INT64_FORMAT,
total_size / (1024 * 1024));
snprintf(current_size_str, sizeof(current_size_str), INT64_FORMAT,
current_size / (1024 * 1024));

fprintf(stderr, _("%*s/%s MB (%d%%) computed"),
(int) strlen(current_size_str), current_size_str, total_size_str,
percent);

--
Regrads,
Japin Li.
ChengDu WenWu Information Technology Co.,Ltd.

Attachment Content-Type Size
remove-workarounds-int64-format-in-pg_checksums.patch text/x-patch 1.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jehan-Guillaume de Rorthais 2022-03-21 10:36:34 Re: Detaching a partition with a FK on itself is not possible
Previous Message Amit Kapila 2022-03-21 10:01:11 Re: logical replication empty transactions