# intarray — Postgres extension

> Functions and indexes for integer arrays.

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

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

## About

intarray adds fast operators and index classes for int[] columns (overlap, contains, contained by) plus helpers such as sort, uniq and idx. A common use is tag or permission id lists stored on the row.

## Enable it

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

## Example

```sql
create index posts_tag_ids on posts using gin (tag_ids gin__int_ops);

select id from posts where tag_ids && array[3, 7];
select sort(uniq(sort(array[5, 3, 5, 1])));   -- {1,3,5}
```

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