Re: appendBinaryStringInfo stuff

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: appendBinaryStringInfo stuff
Date: 2023-02-10 12:15:54
Message-ID: 783a4edb-84f9-6df2-7470-2ef5ccc6607a@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 19.12.22 07:13, Peter Eisentraut wrote:
> Also, the argument type of appendBinaryStringInfo() is char *.  There is
> some code that uses this function to assemble some kind of packed binary
> layout, which requires a bunch of casts because of this.  I think
> functions taking binary data plus length should take void * instead,
> like memcpy() for example.

I found a little follow-up for this one: Make the same change to
pq_sendbytes(), which is a thin wrapper around appendBinaryStringInfo().
This would allow getting rid of further casts at call sites.

Attachment Content-Type Size
0001-Change-argument-type-of-pq_sendbytes-from-char-to-vo.patch text/plain 4.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeroen Vermeulen 2023-02-10 12:19:29 Re: libpq: PQgetCopyData() and allocation overhead
Previous Message Amit Kapila 2023-02-10 12:15:01 Re: Exit walsender before confirming remote flush in logical replication