Re: pg_basebackup --progress output for batch execution

From: Arthur Zakirov <a(dot)zakirov(at)postgrespro(dot)ru>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: Martin Marques <martin(dot)marques(at)2ndquadrant(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_basebackup --progress output for batch execution
Date: 2017-11-10 09:24:30
Message-ID: 20171110092429.GA5549@zakirov.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 09, 2017 at 03:55:36PM -0800, Jeff Janes wrote:
>
> I think I agree with Arthur that I'd rather have the decision made by
> inspecting whether output is going to a tty, rather than by adding another
> command line option. But maybe that is not detected robustly enough across
> all platforms and circumstances?
>

isatty() is used within Postgres code already (for example, pg_upgrade/util.c).
However, it seems that on Windows isatty() is deprecated and it is recommended to use _isatty(). Moreover, on Windows it can give false positive result [1], if I'm not mistaken:

> The _isatty function determines whether fd is associated with a character device (a terminal, console, printer, or serial port).

1 - https://msdn.microsoft.com/en-us/library/f4s0ddew(v=vs.140).aspx

--
Arthur Zakirov
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2017-11-10 09:34:06 Incorrect comment for build_child_join_rel
Previous Message Ashutosh Bapat 2017-11-10 09:15:31 Re: Aggregates push-down to partitions