“Django/docs/2.2.x/ref/contrib/postgres/index”的版本间差异
来自菜鸟教程
Django/docs/2.2.x/ref/contrib/postgres/index
(autoload) |
小 (Page commit) |
||
第1行: | 第1行: | ||
+ | {{DISPLAYTITLE:django.contrib.postgres — Django 文档}} | ||
<div id="module-django.contrib.postgres" class="section"> | <div id="module-django.contrib.postgres" class="section"> | ||
<span id="django-contrib-postgres"></span> | <span id="django-contrib-postgres"></span> | ||
− | = | + | = django.contrib.postgres = |
− | PostgreSQL | + | PostgreSQL 具有许多 Django 支持的其他数据库不共享的功能。 此可选模块包含许多 PostgreSQL 特定数据类型的模型字段和表单字段。 |
− | Django | ||
− | |||
<div class="admonition note"> | <div class="admonition note"> | ||
− | + | 笔记 | |
− | Django | + | Django 是并且将继续是一个与数据库无关的 Web 框架。 我们鼓励那些为 Django 社区编写可重用应用程序的人在可行的情况下编写与数据库无关的代码。 但是,我们认识到使用 Django 编写的现实世界项目不需要与数据库无关。 事实上,一旦项目达到给定的大小,更改底层数据存储已经是一个重大挑战,并且可能需要以某种方式更改代码库以处理数据存储之间的差异。 |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | Django | + | Django 支持多种仅适用于 PostgreSQL 的数据类型。 没有根本原因(例如)<code>contrib.mysql</code> 模块不存在,除了 PostgreSQL 拥有最丰富的受支持数据库的功能集,因此它的用户可以获得最多的收益。 |
− | |||
− | |||
− | |||
− | |||
第31行: | 第19行: | ||
<div class="toctree-wrapper compound"> | <div class="toctree-wrapper compound"> | ||
− | * [[../aggregates|PostgreSQL | + | * [[../aggregates|PostgreSQL 特定的聚合函数]] |
− | ** [[../aggregates#general-purpose-aggregation-functions| | + | ** [[../aggregates#general-purpose-aggregation-functions|通用聚合函数]] |
− | ** [[../aggregates#aggregate-functions-for-statistics| | + | ** [[../aggregates#aggregate-functions-for-statistics|统计聚合函数]] |
− | ** [[../aggregates#usage-examples| | + | ** [[../aggregates#usage-examples|使用示例]] |
− | * [[../fields|PostgreSQL | + | * [[../fields|PostgreSQL 特定模型字段]] |
− | ** [[../fields#indexing-these-fields| | + | ** [[../fields#indexing-these-fields|索引这些字段]] |
** [[../fields#arrayfield|<code>ArrayField</code>]] | ** [[../fields#arrayfield|<code>ArrayField</code>]] | ||
− | ** [[../fields#citext-fields|<code>CIText</code> | + | ** [[../fields#citext-fields|<code>CIText</code> 字段]] |
** [[../fields#hstorefield|<code>HStoreField</code>]] | ** [[../fields#hstorefield|<code>HStoreField</code>]] | ||
** [[../fields#jsonfield|<code>JSONField</code>]] | ** [[../fields#jsonfield|<code>JSONField</code>]] | ||
− | ** [[../fields#range-fields| | + | ** [[../fields#range-fields|范围字段]] |
− | * [[../forms|PostgreSQL | + | * [[../forms|PostgreSQL 特定的表单字段和小部件]] |
** [[../forms#fields|字段]] | ** [[../forms#fields|字段]] | ||
− | ** [[../forms#widgets| | + | ** [[../forms#widgets|小工具]] |
− | * [[../functions|PostgreSQL | + | * [[../functions|PostgreSQL 特定的数据库函数]] |
** [[../functions#randomuuid|<code>RandomUUID</code>]] | ** [[../functions#randomuuid|<code>RandomUUID</code>]] | ||
** [[../functions#transactionnow|<code>TransactionNow</code>]] | ** [[../functions#transactionnow|<code>TransactionNow</code>]] | ||
− | * [[../indexes|PostgreSQL | + | * [[../indexes|PostgreSQL 特定的模型索引]] |
** [[../indexes#brinindex|<code>BrinIndex</code>]] | ** [[../indexes#brinindex|<code>BrinIndex</code>]] | ||
** [[../indexes#btreeindex|<code>BTreeIndex</code>]] | ** [[../indexes#btreeindex|<code>BTreeIndex</code>]] | ||
第55行: | 第43行: | ||
** [[../indexes#hashindex|<code>HashIndex</code>]] | ** [[../indexes#hashindex|<code>HashIndex</code>]] | ||
** [[../indexes#spgistindex|<code>SpGistIndex</code>]] | ** [[../indexes#spgistindex|<code>SpGistIndex</code>]] | ||
− | * [[../lookups|PostgreSQL | + | * [[../lookups|PostgreSQL 特定的查找]] |
− | ** [[../lookups#trigram-similarity| | + | ** [[../lookups#trigram-similarity|三元组相似度]] |
** [[../lookups#unaccent|<code>Unaccent</code>]] | ** [[../lookups#unaccent|<code>Unaccent</code>]] | ||
− | * [[../operations| | + | * [[../operations|数据库迁移操作]] |
− | ** [[../operations#creating-extension-using-migrations| | + | ** [[../operations#creating-extension-using-migrations|使用迁移创建扩展]] |
** [[../operations#createextension|<code>CreateExtension</code>]] | ** [[../operations#createextension|<code>CreateExtension</code>]] | ||
** [[../operations#btreeginextension|<code>BtreeGinExtension</code>]] | ** [[../operations#btreeginextension|<code>BtreeGinExtension</code>]] | ||
第68行: | 第56行: | ||
** [[../operations#trigramextension|<code>TrigramExtension</code>]] | ** [[../operations#trigramextension|<code>TrigramExtension</code>]] | ||
** [[../operations#unaccentextension|<code>UnaccentExtension</code>]] | ** [[../operations#unaccentextension|<code>UnaccentExtension</code>]] | ||
− | * [[../search| | + | * [[../search|全文检索]] |
− | ** [[../search#the-search-lookup| | + | ** [[../search#the-search-lookup|<code>search</code> 查找]] |
** [[../search#searchvector|<code>SearchVector</code>]] | ** [[../search#searchvector|<code>SearchVector</code>]] | ||
** [[../search#searchquery|<code>SearchQuery</code>]] | ** [[../search#searchquery|<code>SearchQuery</code>]] | ||
** [[../search#searchrank|<code>SearchRank</code>]] | ** [[../search#searchrank|<code>SearchRank</code>]] | ||
− | ** [[../search#changing-the-search-configuration| | + | ** [[../search#changing-the-search-configuration|更改搜索配置]] |
− | ** [[../search#weighting-queries| | + | ** [[../search#weighting-queries|加权查询]] |
− | ** [[../search#performance| | + | ** [[../search#performance|表现]] |
− | ** [[../search#trigram-similarity| | + | ** [[../search#trigram-similarity|三元组相似度]] |
− | * [[../validators| | + | * [[../validators|验证器]] |
** [[../validators#keysvalidator|<code>KeysValidator</code>]] | ** [[../validators#keysvalidator|<code>KeysValidator</code>]] | ||
− | ** [[../validators#range-validators| | + | ** [[../validators#range-validators|范围验证器]] |
第85行: | 第73行: | ||
</div> | </div> | ||
+ | <div class="clearer"> | ||
− | [[Category:Django 2.2.x | + | |
+ | |||
+ | </div> | ||
+ | |||
+ | [[Category:Django 2.2.x 文档]] |
2021年10月31日 (日) 04:05的最新版本
django.contrib.postgres
PostgreSQL 具有许多 Django 支持的其他数据库不共享的功能。 此可选模块包含许多 PostgreSQL 特定数据类型的模型字段和表单字段。
笔记
Django 是并且将继续是一个与数据库无关的 Web 框架。 我们鼓励那些为 Django 社区编写可重用应用程序的人在可行的情况下编写与数据库无关的代码。 但是,我们认识到使用 Django 编写的现实世界项目不需要与数据库无关。 事实上,一旦项目达到给定的大小,更改底层数据存储已经是一个重大挑战,并且可能需要以某种方式更改代码库以处理数据存储之间的差异。
Django 支持多种仅适用于 PostgreSQL 的数据类型。 没有根本原因(例如)contrib.mysql
模块不存在,除了 PostgreSQL 拥有最丰富的受支持数据库的功能集,因此它的用户可以获得最多的收益。