Rethink API for pg_get_line.c, one more time.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 22 Sep 2020 19:55:13 +0000 (15:55 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 22 Sep 2020 19:55:13 +0000 (15:55 -0400)
commit931487018c409a3102452f965ccaa48367244a41
treee959b76c7754b2b7af7bfa593e1825fa0328f88d
parentc4133ec169dfe47803656325dbfb8397f85a70ea
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
src/bin/initdb/initdb.c
src/common/pg_get_line.c
src/include/common/string.h
src/interfaces/ecpg/test/pg_regress_ecpg.c
src/test/regress/pg_regress.c