Re: [HACKERS] pg_basebackup --progress output for batch execution - Mailing list pgsql-hackers

From Arthur Zakirov
Subject Re: [HACKERS] pg_basebackup --progress output for batch execution
Date
Msg-id 20171121075644.GA13720@zakirov.localdomain
Whole thread Raw
In response to Re: [HACKERS] pg_basebackup --progress output for batch execution  (Martín Marqués <martin@2ndquadrant.com>)
Responses Re: [HACKERS] pg_basebackup --progress output for batch execution
List pgsql-hackers
On Mon, Nov 20, 2017 at 04:45:48PM -0300, Martín Marqués wrote:
> New version of patch, without the --batch-mode option and using isatty()
> 

Great!

> +        fprintf(stderr, "waiting for checkpoint");
> +        if (isatty(fileno(stderr)))
> +            fprintf(stderr, "\n");
> +        else
> +            fprintf(stderr, "\r");

Here the condition should be inverted I think. The next condition should be used:

> if (!isatty(fileno(stderr)))
> ...

Otherwise pg_basebackup will insert '\n' in terminal instead '\r'.

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


pgsql-hackers by date:

Previous
From: Rafia Sabih
Date:
Subject: Re: [HACKERS] Parallel Append implementation
Next
From: Amit Khandekar
Date:
Subject: Re: [HACKERS] Parallel Append implementation