pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Georgios <gkokolatos@protonmail.com>
Cc: pasim@vmware.com <pasim@vmware.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: [PATCH] - Provide robust alternatives for replace_string
Date: Fri, 31 Jul 2020 21:52:02 -0400
Message-ID: <20200801015202.GA17318@alvherre.pgsql> (raw)
In-Reply-To: <y9Dlk2QhiZ39DhaB1QE9mgZ95HcOQKZCNtGwN7XCRKMdBRBnX_0woaRUtTjloEp4PKA6ERmcUcfq3lPGfKPOJ5xX2TV-5WoRYyySeNHRzdw=@protonmail.com>

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





view thread (10+ messages)  latest in thread

Message-ID: <20200801015202.GA17318@alvherre.pgsql>
Permalink:  ../20200801015202.GA17318@alvherre.pgsql/
Also on:    postgresql.org/message-id/20200801015202.GA17318@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@2ndquadrant.com, gkokolatos@protonmail.com, pasim@vmware.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: [PATCH] - Provide robust alternatives for replace_string
  In-Reply-To: <20200801015202.GA17318@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox