Postgresql 中文操作指南

N.2. Configuring the Colors #

要使用的实际颜色使用环境变量 PG_COLORS 配置(注意,是复数)。值是 key=value 对的冒号分隔列表。键指定要将颜色用于什么内容。值是终端解释的 SGR(选择图形显示)规范。

The actual colors to be used are configured using the environment variable PG_COLORS (note plural). The value is a colon-separated list of key_=_value pairs. The keys specify what the color is to be used for. The values are SGR (Select Graphic Rendition) specifications, which are interpreted by the terminal.

当前使用的键为:

The following keys are currently in use:

  • error

    • used to highlight the text “error” in error messages

  • warning

    • used to highlight the text “warning” in warning messages

  • note

    • used to highlight the text “detail” and “hint” in such messages

  • locus

    • used to highlight location information (e.g., program name and file name) in messages

默认值为_error=01;31:warning=01;35:note=01;36:locus=01_ (01;31 = 粗体红色,01;35 = 粗体品红,01;36 = 粗体青色,01 = 粗体默认颜色)。

The default value is error=01;31:warning=01;35:note=01;36:locus=01 (01;31 = bold red, 01;35 = bold magenta, 01;36 = bold cyan, 01 = bold default color).

Tip

此颜色指定格式也由其他软件包(如 GCC、GNU coreutils 和 GNU grep)使用。

This color specification format is also used by other software packages such as GCC, GNU coreutils, and GNU grep.