Re: libpq debug log

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: tsunakawa(dot)takay(at)fujitsu(dot)com
Cc: alvherre(at)alvh(dot)no-ip(dot)org, iwata(dot)aya(at)fujitsu(dot)com, tgl(at)sss(dot)pgh(dot)pa(dot)us, k(dot)jamison(at)fujitsu(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: libpq debug log
Date: 2021-03-11 04:31:20
Message-ID: 20210311.133120.1217710137676715168.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Thu, 11 Mar 2021 04:12:57 +0000, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com> wrote in
> From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
> > Right. So something like this?
> >
> > unsigned char p;
> >
> > p = buf + *cursor;
> > result = (uint32) (*p << 24) + (*(p + 1)) << 16 + ...);
>
> Yes, that would work (if p is a pointer), but I think memcpy() is enough like pqGetInt() does.

On second thought, memcpy onto a local variable doesn't harm. I agreed
to you.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2021-03-11 04:37:30 Re: [HACKERS] Custom compression methods
Previous Message Andres Freund 2021-03-11 04:26:56 Re: shared-memory based stats collector