Experiencing postgresql database creation failure. #4623

Closed
opened 2025-12-29 18:38:22 +01:00 by adam · 1 comment
Owner

Originally created by @TheTrafficNetwork on GitHub (Mar 3, 2021).

Originally assigned to: @jeremystretch on GitHub.

Environment

  • Ubuntu 20.04.2 LTS
  • PostgreSQL 12.6 (Ubuntu 12.6-0ubuntu0.20.04.1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, 64-bit

Steps to Reproduce

  1. Fresh Installation of Ubuntu 20.04.2
  2. sudo apt update
  3. sudo apt upgrade
  4. Following steps for database creation:
  • sudo apt install -y postgresql libpq-dev
  • sudo -u postgres psql
    • postgres=# CREATE DATABASE netbox ENCODING 'UTF8' LC_COLLATE='C.UTF-8' LC_CTYPE='C.UTF-8';

Observed Behavior

ERROR: new collation (C.UTF-8) is incompatible with the collation of the template database (en_US.UTF-8)
HINT: Use the same collation as in the template database, or use template0 as template.

Expected behavior

CREATE DATABASE

Note

  • Installation instructions show > psql (12.5 (Ubuntu 12.5-0ubuntu0.20.04.1))
  • Installation using > psql (12.6 (Ubuntu 12.6-0ubuntu0.20.04.1))
  • Changing C.UTF-8 to en_US.UTF-8 allowed the creation of the database, but I do not know if that will affect anything down the line.
Originally created by @TheTrafficNetwork on GitHub (Mar 3, 2021). Originally assigned to: @jeremystretch on GitHub. # Environment - Ubuntu 20.04.2 LTS - PostgreSQL 12.6 (Ubuntu 12.6-0ubuntu0.20.04.1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, 64-bit # Steps to Reproduce 1) Fresh Installation of Ubuntu 20.04.2 2) sudo apt update 3) sudo apt upgrade 4) Following steps for database creation: - sudo apt install -y postgresql libpq-dev - sudo -u postgres psql - postgres=# CREATE DATABASE netbox ENCODING 'UTF8' LC_COLLATE='C.UTF-8' LC_CTYPE='C.UTF-8'; # Observed Behavior ERROR: new collation (C.UTF-8) is incompatible with the collation of the template database (en_US.UTF-8) HINT: Use the same collation as in the template database, or use template0 as template. # Expected behavior CREATE DATABASE # Note - Installation instructions show > psql (12.5 (Ubuntu 12.5-0ubuntu0.20.04.1)) - Installation using > psql (12.6 (Ubuntu 12.6-0ubuntu0.20.04.1)) - Changing C.UTF-8 to en_US.UTF-8 allowed the creation of the database, but I do not know if that will affect anything down the line.
adam added the type: bugstatus: accepted labels 2025-12-29 18:38:22 +01:00
adam closed this issue 2025-12-29 18:38:22 +01:00
Author
Owner

@jeremystretch commented on GitHub (Mar 4, 2021):

Looks like we might need to revert #5760

@jeremystretch commented on GitHub (Mar 4, 2021): Looks like we might need to revert #5760
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4623