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.

a_horse_with_no_name
  • 497,550
  • 91
  • 775
  • 843
Luiz Alves
  • 2,251
  • 4
  • 26
  • 61

1 Answers1

0
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:

a_horse_with_no_name
  • 497,550
  • 91
  • 775
  • 843