Re: [PATCH] - Provide robust alternatives for replace_string
Asim Praveen <pasim@vmware.com>
From: Asim Praveen <pasim@vmware.com>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Georgios <gkokolatos@protonmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2020-08-07T06:02:58Z
Lists: pgsql-hackers
Attachments
- v2-0001-Use-a-stringInfo-instead-of-a-char-for-replace_st.patch (application/octet-stream) patch v2-0001
> On 05-Aug-2020, at 7:01 PM, Alvaro Herrera <alvherre@2ndquadrant.com> wrote: > > On 2020-Aug-05, Asim Praveen wrote: > >> Please find attached a StringInfo based solution to this problem. It >> uses fgetln instead of fgets such that a line is read in full, without >> ever splitting it. > > never heard of fgetln, my system doesn't have a manpage for it, and we > don't use it anywhere AFAICS. Are you planning to add something to > src/common for it? > Indeed! I noticed fgetln on the man page of fgets and used it without checking. And this happened on a MacOS system. Please find a revised version that uses fgetc instead. Asim
Commits
-
Refactor pg_get_line() to expose an alternative StringInfo-based API.
- 8e3c58e6e459 14.0 landed
-
Remove arbitrary line length limits in pg_regress (plain and ECPG).
- 784b1ba1a2b9 14.0 landed
-
Remove arbitrary restrictions on password length.
- 67a472d71c98 14.0 cited