postgresqlpsqlpostgresql-16

What does `+` (plus) means next to enum elements


I'm playing with Postgresql ENUM types, and noticed something I can't find explanation for:

 Schema |       Name        |   Internal name   | Size | Elements |  Owner   | Access privileges | Description
--------+-------------------+-------------------+------+----------+----------+-------------------+-------------
 public | medical_code_type | medical_code_type | 4    | cpt     +| postgres |                   |
        |                   |                   |      | icd     +|          |                   |
        |                   |                   |      | hcpcs    |          |                   |

There's a plus (+) sign next to the elements (enum values) except the last one. Once I run ALTER TYPE medical_code_type ADD VALUE 'icd-10-cm' the new one does not have the plus, and all the other do.

 Schema |       Name        |   Internal name   | Size | Elements  |  Owner   | Access privileges | Description
--------+-------------------+-------------------+------+-----------+----------+-------------------+-------------
 public | medical_code_type | medical_code_type | 4    | cpt      +| postgres |                   |
        |                   |                   |      | icd      +|          |                   |
        |                   |                   |      | hcpcs    +|          |                   |
        |                   |                   |      | icd-10-cm |          |                   |
(1 row)

Does the + have any meaning here?


Solution

  • Yes this is from psql, no it is not related to enums or types. It is the new line indicator per psql:

    linestyle

    Sets the border line drawing style to one of ascii, old-ascii, or unicode. Unique abbreviations are allowed. (That would mean one letter is enough.) The default setting is ascii. This option only affects the aligned and wrapped output formats.

    ascii style uses plain ASCII characters. Newlines in data are shown using a + symbol in the right-hand margin. When the wrapped format wraps data from one line to the next without a newline character, a dot (.) is shown in the right-hand margin of the first line, and again in the left-hand margin of the following line.