Re: Small memory fixes for pg_createsubcriber

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)anarazel(dot)de>, Euler Taveira <euler(at)eulerto(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Small memory fixes for pg_createsubcriber
Date: 2025-02-27 05:50:39
Message-ID: Z7_9LxlEHthCz_9S@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

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