Re: pgbench -i progress output on terminal

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgbench -i progress output on terminal
Date: 2019-11-30 11:28:55
Message-ID: CA+HiwqH6ik4NBtKqEn8zsB=8Z=8HEH+X5jY-ztNM4Jf39AQR-Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Fabien,

Thanks for taking a look again.

On Sat, Nov 30, 2019 at 4:28 PM Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> wrote:
> > I have updated the patch based on these observations. Attached v2.
>
> Patch v2 applies & compiles cleanly, works for me.
>
> I'm not partial to Hungarian notation conventions, which is not widely
> used elsewhere in pg. I'd suggest eolchar -> eol or line_end or whatever,
> but others may have different opinion. Maybe having a char variable is a
> rare enough occurence which warrants advertising it.

On second thought, I'm fine with just eol.

> Maybe use fputc instead of fprintf in the closing output?

OK, done.

> I'm unsure about what happens on MacOS and Windows terminal, but if it
> works for other commands progress options, it is probably all right.

I wrote the v1 patch on CentOS Linux, and now on MacOS. It would be
great if someone can volunteer to test on Windows terminal.

Attached v3.

Thanks,
Amit

Attachment Content-Type Size
compactify-pgbench-init-progress-output_v3.patch application/octet-stream 2.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexey Bashtanov 2019-11-30 12:35:23 Re: log bind parameter values on error
Previous Message Petr Fedorov 2019-11-30 09:28:18 Since '2001-09-09 01:46:40'::timestamp microseconds are lost when extracting epoch