# citext — Postgres extension

> Case-insensitive text, for emails and user names.

Source: https://scribase.com/extensions/citext

Category: Data types. Version: 1.6. Optional, enabled per project.

## About

citext is a text type that compares case-insensitively. A unique constraint on a citext email column stops Ana@Example.com and ana@example.com from becoming two accounts, without lower() calls in every query and index.

## Enable it

```sql
create extension if not exists citext with schema extensions;
```

## Example

```sql
create table accounts (
  id bigint generated always as identity primary key,
  email citext not null unique
);

select * from accounts where email = 'ANA@EXAMPLE.COM';
```

Upstream: https://www.postgresql.org/docs/17/citext.html