Re: Small memory fixes for pg_createsubcriber - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Small memory fixes for pg_createsubcriber
Date
Msg-id Z7_9LxlEHthCz_9S@paquier.xyz
Whole thread Raw
In response to Re: Small memory fixes for pg_createsubcriber  (Ranier Vilela <ranier.vf@gmail.com>)
List pgsql-hackers
On Tue, Feb 25, 2025 at 08:54:31AM -0300, Ranier Vilela wrote:
> @@ -455,7 +455,9 @@ set_locale_and_encoding(void)
>   locale->db_locale,
>   strlen(locale->db_locale));
>   else
> - datlocale_literal = pg_strdup("NULL");
> + datlocale_literal = PQescapeLiteral(conn_new_template1,
> + "NULL",
> + strlen("NULL"));

Yeah, I've considered that but hardcoding NULL twice felt a bit weird,
as well.  Perhaps it's slightly cleaner to use an intermediate
variable given then as an argument of PQescapeLiteral()?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: vignesh C
Date:
Subject: Re: psql \dh: List High-Level (Root) Tables and Indexes
Next
From: Bertrand Drouvot
Date:
Subject: Re: [BUG]: the walsender does not update its IO statistics until it exits