PostGreSQL and citext

sql
Tags: #<Tag:0x00007f46dbc9be30>

#1

F.7. citext
The citext module provides a case-insensitive character string type, citext. Essentially, it internally calls lower when comparing values. Otherwise, it behaves almost exactly like text.

CREATE EXTENSION citext;

CREATE TABLE users (
    nick CITEXT PRIMARY KEY,
    pass TEXT   NOT NULL
);