Re: Printing LSN made easy

From: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
To: Li Japin <japinli(at)hotmail(dot)com>
Cc: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, Alexey Kondratov <a(dot)kondratov(at)postgrespro(dot)ru>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Craig Ringer <craig(dot)ringer(at)enterprisedb(dot)com>
Subject: Re: Printing LSN made easy
Date: 2020-12-03 06:13:41
Message-ID: CAGEoWWS_OavSm3Yyfh_vHBp0qvjDwbMhcT3=dnVfKr5dA_88Qg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 30, 2020 at 7:38 PM Li Japin <japinli(at)hotmail(dot)com> wrote:

> Hi,
>
> On Nov 30, 2020, at 9:06 PM, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
> wrote:
>
> On Fri, Nov 27, 2020 at 9:51 PM Li Japin <japinli(at)hotmail(dot)com> wrote:
>
>
> Hi,
>
> Here, we cannot use sizeof(but) to get the buf size, because it is a
> pointer, so it always
> 8 bytes on 64-bit or 4 bytes on 32-bit machine.
>
>
> For an array, the sizeof() returns the size of memory consumed by the
> array. See section "Application to arrays" at
> https://en.wikipedia.org/wiki/Sizeof.
>
>
> That’s true! However, in pg_lsn_out_buffer(), it converts to a pointer,
> not an array. See the following test:
>
>
Ah! Thanks for pointing that out. I have fixed this in my repository.
However, from Alvaro's reply it looks like the approach is not acceptable,
so I am not posting the fixed version here.

--
Best Wishes,
Ashutosh

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2020-12-03 06:33:27 Github Actions (CI)
Previous Message Craig Ringer 2020-12-03 06:10:38 Re: Two fsync related performance issues?