Re: [PATCH] - Provide robust alternatives for replace_string - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: [PATCH] - Provide robust alternatives for replace_string
Date
Msg-id 20200801015202.GA17318@alvherre.pgsql
Whole thread Raw
In response to [PATCH] - Provide robust alternatives for replace_string  (Georgios <gkokolatos@protonmail.com>)
Responses Re: [PATCH] - Provide robust alternatives for replace_string  (Asim Praveen <pasim@vmware.com>)
List 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



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Concurrency bug in amcheck
Next
From: Dmitry Markman
Date:
Subject: Re: windows config.pl question