Re: Count output lines automatically in psql/help.c

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Count output lines automatically in psql/help.c
Date: 2022-06-04 16:56:59
Message-ID: 573743.1654361819@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Phil Florent 2022-06-04 21:18:02 Error from the foreign RDBMS on a foreign table I have no privilege on
Previous Message Alvaro Herrera 2022-06-04 16:18:20 Re: Count output lines automatically in psql/help.c