From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Rethink API for pg_get_line.c, one more time.
Date: Tue, 22 Sep 2020 20:03:41 +0000
Message-ID: <E1kKoVp-0001Ld-U9@gemulon.postgresql.org> (raw)
Rethink API for pg_get_line.c, one more time.
Further experience says that the appending behavior offered by
pg_get_line_append is useful to only a very small minority of callers.
For most, the requirement to reset the buffer after each line is just
an error-prone nuisance. Hence, invent another alternative call
pg_get_line_buf, which takes care of that detail.
Noted while reviewing a patch from Daniel Gustafsson.
Discussion: https://postgr.es/m/48A4FA71-524E-41B9-953A-FD04EF36E2E7@yesql.se
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/931487018c409a3102452f965ccaa48367244a41
Modified Files
--------------
src/bin/initdb/initdb.c | 4 +---
src/common/pg_get_line.c | 29 ++++++++++++++++++++++++++++-
src/include/common/string.h | 1 +
src/interfaces/ecpg/test/pg_regress_ecpg.c | 3 +--
src/test/regress/pg_regress.c | 3 +--
5 files changed, 32 insertions(+), 8 deletions(-)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Rethink API for pg_get_line.c, one more time.
In-Reply-To: <E1kKoVp-0001Ld-U9@gemulon.postgresql.org>
References: <E1kKoVp-0001Ld-U9@gemulon.postgresql.org>
* 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