BUG #16108: Colorization to the output of command-line has unproperly behaviors at Windows platform

The Post Office <noreply@postgresql.org>

From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: tanghy.fnst@cn.fujitsu.com
Date: 2019-11-12T08:29:10Z
Lists: pgsql-bugs, pgsql-hackers
The following bug has been logged on the website:

Bug reference:      16108
Logged by:          Haiying Tang
Email address:      tanghy.fnst@cn.fujitsu.com
PostgreSQL version: 12.0
Operating system:   Windows
Description:        

Hello

I found the following release notes in PG12 is not working properly at
Windows.
> •Add colorization to the output of command-line utilities

Following the release note, I've set the the environment variable PG_COLOR
to auto, then I run pg_dump command with an incorrect passwd.
However, the command-line output is not colorized as the release notes
said.

Before  PG_COLOR=auto is set: pg_dump: error: connection to database
"tanghy.fnst" failed: FATAL:
After PG_COLOR=auto is set: pg_dump: error: connection
to database "tanghy.fnst" failed: FATAL

I think the colorization to the output of command-line is not supported at
Windows.
Maybe function "pg_logging_init" at source "src\common\logging.c" should add
a platform check.
Besides, the related release note of PG12 should add some description about
it.

Best Regards,
Tang

Commits

  1. Fix command-line colorization on Windows with VT100-compatible environments