Re: [PATCH] - Provide robust alternatives for replace_string

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Georgios <gkokolatos(at)protonmail(dot)com>
Cc: "pasim(at)vmware(dot)com" <pasim(at)vmware(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] - Provide robust alternatives for replace_string
Date: 2020-08-01 01:52:02
Message-ID: 20200801015202.GA17318@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

What happens if a replacement string happens to be split in the middle
by the fgets buffering? I think it'll fail to be replaced. This
applies to both versions.

In the stringinfo version it seemed to me that using pnstrdup is
possible to avoid copying trailing bytes.

If you're asking for opinion, mine is that StringInfo looks to be the
better approach, and also you don't need to keep API compatibility.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dmitry Markman 2020-08-01 02:41:46 Re: windows config.pl question
Previous Message Peter Geoghegan 2020-08-01 00:23:00 Re: Concurrency bug in amcheck