scribase
Data typesversion 1.6

citext

Case-insensitive text, for emails and user names.

What it is for

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';

Questions

How do I enable citext?

Run create extension if not exists citext with schema extensions; in the SQL editor, or switch it on from the Extensions page in the console. You do not need superuser access.

Which version of citext is installed?

1.6, on Postgres 17.6, as read from the running engine on 2026-10-08. Check yours with: select extversion from pg_extension where extname = 'citext';

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

More data types extensions

  • uuid-ossp UUID generators (v1 to v5).
  • pg_uuidv7 Time-ordered UUID v7 values.
  • hstore Key-value pairs in one column.
  • ltree Tree paths such as categories and org charts.
  • intarray Functions and indexes for integer arrays.
  • cube Multi-dimensional points and boxes.