Skip to content

[Bug]: Error during creating Postgresql database #1021

@webard

Description

@webard

Installation Type *

VPS

Vito Version *

3.20.0

Describe the Bug *

There is an error during Postgresql database creation:

ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII) HINT: Use the same encoding as in the template database, or use template0 as template. SSH command failed with an error

The fix requires change template1 collation to unicode, so this script should be run during postgresql installation:

postgres=# UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1';

postgres=# DROP DATABASE template1;

postgres=# CREATE DATABASE template1 WITH TEMPLATE = template0 ENCODING = 'UNICODE';

After this steps, database creation from UI works perfect.

The case occurs probably in all versions of pgsql, but I tested 17 and 18.

Steps to Reproduce *

  1. Install postgreSQl
  2. create database user
  3. create database

Expected Behavior *

Database should be created

Logs *

ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII) HINT: Use the same encoding as in the template database, or use template0 as template. SSH command failed with an error

Screenshots

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions