
February 26, 2026: [PostgreSQL 18.3, 17.9, 16.13, 15.17, and 14.22 Released!](/about/news/postgresql-183-179-1613-1517-and-1422-released-3246/)

[Documentation](/docs/ "Documentation") → [PostgreSQL 18](/docs/18/index.html)

Supported Versions: [Current](/docs/current/color-when.html "PostgreSQL 18 - N.1. When Color is Used") ([18](/docs/18/color-when.html "PostgreSQL 18 - N.1. When Color is Used")) / [17](/docs/17/color-when.html "PostgreSQL 17 - N.1. When Color is Used") / [16](/docs/16/color-when.html "PostgreSQL 16 - N.1. When Color is Used") / [15](/docs/15/color-when.html "PostgreSQL 15 - N.1. When Color is Used") / [14](/docs/14/color-when.html "PostgreSQL 14 - N.1. When Color is Used")

Development Versions: [devel](/docs/devel/color-when.html "PostgreSQL devel - N.1. When Color is Used")

Unsupported versions: [13](/docs/13/color-when.html "PostgreSQL 13 - N.1. When Color is Used")

## N.1. When Color is Used [#](#COLOR-WHEN)

To use colorized output, set the environment variable `PG_COLOR` as follows:

1.  If the value is `always`, then color is used.
    
2.  If the value is `auto` and the standard error stream is associated with a terminal device, then color is used.
    
3.  Otherwise, color is not used.
    

## Submit correction

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use [this form](/account/comments/new/18/color-when.html/) to report a documentation issue.
