0

I need to migrate a mysql table to postgresql.

I need an accent and case insensitive database.

In mysql, my database has the next definition:

CREATE DATABASE gestan 
DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

How do I create an equivalent definition to postgresql?

I have read some posts, but it seems outdated.

Luiz Alves
  • 2,575
  • 4
  • 34
  • 75

1 Answers1

1
create database getan
   encoding = 'UTF-8';

There is no direct equivalent for the case insensitive collation _ci in Postgres.

You can define a new ICU collation that uses case insensitive comparison, but it can't be used as a default collation for a database, only for the collation on column level.

Related questions: