Re: remove unnecessary explicit type conversion (to char) for appendStringInfoChar function calls

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Mahendra Singh Thalor <mahi6run(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: remove unnecessary explicit type conversion (to char) for appendStringInfoChar function calls
Date: 2025-04-13 12:12:05
Message-ID: 202504131212.7awgygnfvtef@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2025-Apr-12, Andrew Dunstan wrote:

> Seems odd that this one is necessary at all. Doesn't a StringInfo always
> have a trailing null byte?

AFAICT what this is doing that's significant, is increment StringInfo->len.
Before doing it, the NUL byte is not part of the message; afterwards it
is.

--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
"The important things in the world are problems with society that we don't
understand at all. The machines will become more complicated but they won't
be more complicated than the societies that run them." (Freeman Dyson)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mahendra Singh Thalor 2025-04-13 13:02:01 pg_restore --format= option(without any value) should report an error as pg_dump is reporting an error
Previous Message wenhui qiu 2025-04-13 11:37:47 Re: TOAST versus toast