# Postgrex

> PostgreSQL driver for Elixir

Source: https://talira.ai/catalog/postgrex-wrgb4p9b
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / databases / drivers](https://talira.ai/categories/libraries/databases/drivers), [languages / elixir](https://talira.ai/categories/languages/elixir)
- Licence: Apache-2.0[^1]
- Pricing: Free and open source
- Free tier: yes

Postgrex is the PostgreSQL driver for Elixir, and the adapter underneath [Ecto](https://talira.ai/catalog/ecto-dq6bsaxc.md)'s PostgreSQL support. It speaks PostgreSQL's binary protocol and encodes and decodes Elixir values to and from it automatically, covering numerics as Decimal, dates and timestamps, intervals, arrays, composite types, ranges and multiranges, UUIDs, hstore, enums, bit strings and full-text search vectors, and user-defined extensions handle any other type. It supports transactions, prepared queries and connection pools through DBConnection, and works with PostgreSQL 8.4 and later.

## Links

- GitHub: https://github.com/elixir-ecto/postgrex
- Docs: https://hexdocs.pm/postgrex/

## Problems it solves

- connect to PostgreSQL from Elixir
- run raw SQL queries against Postgres in an Elixir app without Ecto
- decode Postgres arrays, ranges and composite types into Elixir values
- add support for a custom PostgreSQL type in Elixir
- pool PostgreSQL connections in an Elixir application

## Features

- binary protocol with automatic encoding and decoding
- arrays, composite types, ranges, multiranges, hstore, enums and tsvector
- user-defined type extensions
- transactions and prepared queries
- connection pools via DBConnection
- PostgreSQL 8.4 and later

## Trust

Overall: 0.48 out of 1.
Signals: maintenance 0.68, adoption 0.62, momentum 0.28, community 0.88, backing 0.00, extensibility 0.00.

- last commit 8 days ago
- 12 commits in the last 90 days
- latest release v0.7.0 11.9 years ago
- 1.2k GitHub stars
- 161 contributors

## Related

- Works with [PostgreSQL](https://talira.ai/catalog/postgresql-cm55wcnd.md)
- Works with [Ecto](https://talira.ai/catalog/ecto-dq6bsaxc.md)

## Alternatives

- [MyXQL](https://talira.ai/catalog/myxql-8g0pgsdy.md): MySQL driver for Elixir
- [epgsql](https://talira.ai/catalog/epgsql-1qh8yx6n.md): Asynchronous PostgreSQL client for Erlang

## Sources

[^1]: https://hex.pm/packages/postgrex (checked 25 Nov 2026)
[^2]: https://github.com/elixir-ecto/postgrex (checked 25 Nov 2026)
