---
title: "django.contrib.postgres"
version: 1.10
locale: el
source: https://docs.djangoproject.com/el/1.10/ref/contrib/postgres/
canonical: https://djangodocs.dev/el/1.10/ref/contrib/postgres/
---
# `django.contrib.postgres`

PostgreSQL has a number of features which are not shared by the other databases
Django supports. This optional module contains model fields and form fields for
a number of PostgreSQL specific data types.

Psycopg2 2.5 or higher is required, though we highly recommend using the latest
release. Some fields require higher versions.

> **Note**
>
> Django is, and will continue to be, a database-agnostic web framework. We
> would encourage those writing reusable applications for the Django
> community to write database-agnostic code where practical. However, we
> recognize that real world projects written using Django need not be
> database-agnostic. In fact, once a project reaches a given size changing
> the underlying data store is already a significant challenge and is likely
> to require changing the code base in some ways to handle differences
> between the data stores.
>
> Django provides support for a number of data types which will
> only work with PostgreSQL. There is no fundamental reason why (for example)
> a `contrib.mysql` module does not exist, except that PostgreSQL has the
> richest feature set of the supported databases so its users have the most
> to gain.

- [PostgreSQL specific aggregation functions](/el/1.10/ref/contrib/postgres/aggregates/)

  - [General-purpose aggregation functions](/el/1.10/ref/contrib/postgres/aggregates/#general-purpose-aggregation-functions)
  - [Aggregate functions for statistics](/el/1.10/ref/contrib/postgres/aggregates/#aggregate-functions-for-statistics)
  - [Usage examples](/el/1.10/ref/contrib/postgres/aggregates/#usage-examples)
- [PostgreSQL specific model fields](/el/1.10/ref/contrib/postgres/fields/)

  - [`ArrayField`](/el/1.10/ref/contrib/postgres/fields/#arrayfield)
  - [`HStoreField`](/el/1.10/ref/contrib/postgres/fields/#hstorefield)
  - [`JSONField`](/el/1.10/ref/contrib/postgres/fields/#jsonfield)
  - [Range Fields](/el/1.10/ref/contrib/postgres/fields/#range-fields)
- [PostgreSQL specific form fields and widgets](/el/1.10/ref/contrib/postgres/forms/)

  - [Fields](/el/1.10/ref/contrib/postgres/forms/#fields)
  - [Widgets](/el/1.10/ref/contrib/postgres/forms/#widgets)
- [PostgreSQL specific database functions](/el/1.10/ref/contrib/postgres/functions/)

  - [`TransactionNow`](/el/1.10/ref/contrib/postgres/functions/#transactionnow)
- [PostgreSQL specific lookups](/el/1.10/ref/contrib/postgres/lookups/)

  - [Trigram similarity](/el/1.10/ref/contrib/postgres/lookups/#trigram-similarity)
  - [`Unaccent`](/el/1.10/ref/contrib/postgres/lookups/#unaccent)
- [Database migration operations](/el/1.10/ref/contrib/postgres/operations/)

  - [Creating extension using migrations](/el/1.10/ref/contrib/postgres/operations/#creating-extension-using-migrations)
  - [`CreateExtension`](/el/1.10/ref/contrib/postgres/operations/#createextension)
  - [`HStoreExtension`](/el/1.10/ref/contrib/postgres/operations/#hstoreextension)
  - [`TrigramExtension`](/el/1.10/ref/contrib/postgres/operations/#trigramextension)
  - [`UnaccentExtension`](/el/1.10/ref/contrib/postgres/operations/#unaccentextension)
- [Full text search](/el/1.10/ref/contrib/postgres/search/)

  - [The `search` lookup](/el/1.10/ref/contrib/postgres/search/#the-search-lookup)
  - [`SearchVector`](/el/1.10/ref/contrib/postgres/search/#searchvector)
  - [`SearchQuery`](/el/1.10/ref/contrib/postgres/search/#searchquery)
  - [`SearchRank`](/el/1.10/ref/contrib/postgres/search/#searchrank)
  - [Changing the search configuration](/el/1.10/ref/contrib/postgres/search/#changing-the-search-configuration)
  - [Weighting queries](/el/1.10/ref/contrib/postgres/search/#weighting-queries)
  - [Performance](/el/1.10/ref/contrib/postgres/search/#performance)
  - [Trigram similarity](/el/1.10/ref/contrib/postgres/search/#trigram-similarity)
- [Validators](/el/1.10/ref/contrib/postgres/validators/)

  - [`KeysValidator`](/el/1.10/ref/contrib/postgres/validators/#keysvalidator)
  - [Range validators](/el/1.10/ref/contrib/postgres/validators/#range-validators)
