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

- [Fungsi pengumpulan khusus PostgreSQL](/id/1.10/ref/contrib/postgres/aggregates/)

  - [Fungsi pengumpulan tujuan-umum](/id/1.10/ref/contrib/postgres/aggregates/#general-purpose-aggregation-functions)
  - [Fungsi-fungsi pengumpulan untuk statistik](/id/1.10/ref/contrib/postgres/aggregates/#aggregate-functions-for-statistics)
  - [Contoh penggunaan](/id/1.10/ref/contrib/postgres/aggregates/#usage-examples)
- [Bidang-bidang model khusus PostgreSQL](/id/1.10/ref/contrib/postgres/fields/)

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

  - [Bidang](/id/1.10/ref/contrib/postgres/forms/#fields)
  - [Widget](/id/1.10/ref/contrib/postgres/forms/#widgets)
- [PostgreSQL specific database functions](/id/1.10/ref/contrib/postgres/functions/)

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

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

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

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

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