From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Count output lines automatically in psql/help.c
Date: Sat, 04 Jun 2022 12:56:59 -0400
Message-ID: <573743.1654361819@sss.pgh.pa.us> (raw)
In-Reply-To: <202206041618.2serkebdcmrz@alvherre.pgsql>
References: <202206041618.2serkebdcmrz@alvherre.pgsql>
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> What about adding stringInfoCountLines or something like that?
If we have other use-cases, maybe that'd be worthwhile.
(In the committed patch, I dumbed it down to a plain per-char
loop without the strchr() complication. So it's very little code.
I'm not real sure that strchr would make it faster.)
regards, tom lane
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: tgl@sss.pgh.pa.us, alvherre@alvh.no-ip.org, pgsql-hackers@lists.postgresql.org
Subject: Re: Count output lines automatically in psql/help.c
In-Reply-To: <573743.1654361819@sss.pgh.pa.us>
* 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