---
title: "django.contrib.postgres"
version: 1.11
locale: pl
source: https://docs.djangoproject.com/pl/1.11/ref/contrib/postgres/
canonical: https://djangodocs.dev/pl/1.11/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.

> **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](/pl/1.11/ref/contrib/postgres/aggregates/)

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

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

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

  - [`TransactionNow`](/pl/1.11/ref/contrib/postgres/functions/#transactionnow)
- [PostgreSQL specific model indexes](/pl/1.11/ref/contrib/postgres/indexes/)

  - [`BrinIndex`](/pl/1.11/ref/contrib/postgres/indexes/#brinindex)
  - [`GinIndex`](/pl/1.11/ref/contrib/postgres/indexes/#ginindex)
- [PostgreSQL specific lookups](/pl/1.11/ref/contrib/postgres/lookups/)

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

  - [Creating extension using migrations](/pl/1.11/ref/contrib/postgres/operations/#creating-extension-using-migrations)
  - [`CreateExtension`](/pl/1.11/ref/contrib/postgres/operations/#createextension)
  - [`BtreeGinExtension`](/pl/1.11/ref/contrib/postgres/operations/#btreeginextension)
  - [`CITextExtension`](/pl/1.11/ref/contrib/postgres/operations/#citextextension)
  - [`HStoreExtension`](/pl/1.11/ref/contrib/postgres/operations/#hstoreextension)
  - [`TrigramExtension`](/pl/1.11/ref/contrib/postgres/operations/#trigramextension)
  - [`UnaccentExtension`](/pl/1.11/ref/contrib/postgres/operations/#unaccentextension)
- [Full text search](/pl/1.11/ref/contrib/postgres/search/)

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

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