8000 Set default encoding and collation to UTF-8 · Issue #30 · supabase/postgres · GitHub
[go: up one dir, main page]

Skip to content
Set default encoding and collation to UTF-8 #30
Closed
@doctorpangloss

Description

@doctorpangloss

Feature request

Consider something along the lines of

update pg_database set encoding = 6, datcollate = 'en_US.UTF8', datctype = 'en_US.UTF8' where datname = 'template0';
update pg_database set encoding = 6, datcollate = 'en_US.UTF8', datctype = 'en_US.UTF8' where datname = 'template1';

from https://www.postgresql.org/docs/9.5/manage-ag-templatedbs.html

Describe the solution you'd like

This makes some sensible defaults for the create database command. For some reason this fixes acute problems on Docker for Windows Desktop hosts along with adding this to many different containerized applications, including probably yours:

ENV LANGUAGE=en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8

Describe alternatives you've considered

FROM supabase/postgres:0.13.0
COPY 99-database-customizations.sql /docker-entrypoint-initdb.d/

99-database-customizations.sql:

update pg_database set encoding = 6, datcollate = 'en_US.UTF8', datctype = 'en_US.UTF8' where datname = 'template0';
update pg_database set encoding = 6, datcollate = 'en_US.UTF8', datctype = 'en_US.UTF8' where datname = 'template1';

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0