↑↓ 选择↵ 打开⌫ 切换范围完整搜索

PG.CENTER 连接 PostgreSQL 文档、百科与生态知识。由 Pigsty 维护。

Wiki / 版本

UNIQUE NULLS NOT DISTINCT

已记录的来源状态与原始语言说明;缺少版本证据时明确标为未知。

来源快照记录 PostgreSQL 8.1–18 的变化节点;历史矩阵独立记录 7.4–18 的状态。两者均未记录 PostgreSQL 19 或 20 的支持状态,较新版本明确保留为未知。这些来源声明与运行测量相互独立。

索引和约束

说明

默认情况下 NULL 彼此不同;在唯一索引或唯一约束上指定 NULLS NOT DISTINCT 后,NULL 会被视为不再互异。

所选版本: PostgreSQL 18

支持

比较版本

原始文档链接

已记录旧标识: 392

完整来源事实与出处

yaml · center · 1dd22bf9a7f3ec325b894e2836fda535a25529f246a94dd41d6abbfe9997f7fd

{
  "Key": "unique-nulls-not-distinct",
  "SourceKind": "yaml",
  "SourceDatabase": "center",
  "SourceTable": "featurematrix.yaml",
  "SourceKey": "UNIQUE NULLS NOT DISTINCT",
  "SourceHash": "1dd22bf9a7f3ec325b894e2836fda535a25529f246a94dd41d6abbfe9997f7fd",
  "Name": "UNIQUE NULLS NOT DISTINCT",
  "NameLocale": "en",
  "GroupKey": "indexing-constraints",
  "GroupName": "Indexing \u0026 Constraints",
  "GroupLocale": "en",
  "Ordinal": 27,
  "GroupOrder": 2,
  "Facts": {
    "feature": {
      "description": "By default, `NULL` values are treated as distinct entries. Specifying `NULLS NOT DISTINCT` on unique indexes / constraints will cause `NULL` to be treated as not distinct, or in other words, equivalently.",
      "name": "UNIQUE NULLS NOT DISTINCT",
      "versions": {
        "15": "Yes"
      }
    },
    "group": "Indexing \u0026 Constraints",
    "versions": {
      "max": 18,
      "min": 8.1
    }
  },
  "Cells": [
    {
      "Version": "10",
      "State": "no",
      "EvidenceKind": "yaml-default-no",
      "TransitionVersion": "",
      "Supported": false,
      "Original": "No"
    },
    {
      "Version": "11",
      "State": "no",
      "EvidenceKind": "yaml-default-no",
      "TransitionVersion": "",
      "Supported": false,
      "Original": "No"
    },
    {
      "Version": "12",
      "State": "no",
      "EvidenceKind": "yaml-default-no",
      "TransitionVersion": "",
      "Supported": false,
      "Original": "No"
    },
    {
      "Version": "13",
      "State": "no",
      "EvidenceKind": "yaml-default-no",
      "TransitionVersion": "",
      "Supported": false,
      "Original": "No"
    },
    {
      "Version": "14",
      "State": "no",
      "EvidenceKind": "yaml-default-no",
      "TransitionVersion": "",
      "Supported": false,
      "Original": "No"
    },
    {
      "Version": "15",
      "State": "yes",
      "EvidenceKind": "yaml-transition",
      "TransitionVersion": "15",
      "Supported": true,
      "Original": "Yes"
    },
    {
      "Version": "16",
      "State": "yes",
      "EvidenceKind": "yaml-transition",
      "TransitionVersion": "15",
      "Supported": true,
      "Original": "Yes"
    },
    {
      "Version": "17",
      "State": "yes",
      "EvidenceKind": "yaml-transition",
      "TransitionVersion": "15",
      "Supported": true,
      "Original": "Yes"
    },
    {
      "Version": "18",
      "State": "yes",
      "EvidenceKind": "yaml-transition",
      "TransitionVersion": "15",
      "Supported": true,
      "Original": "Yes"
    },
    {
      "Version": "8.1",
      "State": "no",
      "EvidenceKind": "yaml-default-no",
      "TransitionVersion": "",
      "Supported": false,
      "Original": "No"
    },
    {
      "Version": "8.2",
      "State": "no",
      "EvidenceKind": "yaml-default-no",
      "TransitionVersion": "",
      "Supported": false,
      "Original": "No"
    },
    {
      "Version": "8.3",
      "State": "no",
      "EvidenceKind": "yaml-default-no",
      "TransitionVersion": "",
      "Supported": false,
      "Original": "No"
    },
    {
      "Version": "8.4",
      "State": "no",
      "EvidenceKind": "yaml-default-no",
      "TransitionVersion": "",
      "Supported": false,
      "Original": "No"
    },
    {
      "Version": "9.0",
      "State": "no",
      "EvidenceKind": "yaml-default-no",
      "TransitionVersion": "",
      "Supported": false,
      "Original": "No"
    },
    {
      "Version": "9.1",
      "State": "no",
      "EvidenceKind": "yaml-default-no",
      "TransitionVersion": "",
      "Supported": false,
      "Original": "No"
    },
    {
      "Version": "9.2",
      "State": "no",
      "EvidenceKind": "yaml-default-no",
      "TransitionVersion": "",
      "Supported": false,
      "Original": "No"
    },
    {
      "Version": "9.3",
      "State": "no",
      "EvidenceKind": "yaml-default-no",
      "TransitionVersion": "",
      "Supported": false,
      "Original": "No"
    },
    {
      "Version": "9.4",
      "State": "no",
      "EvidenceKind": "yaml-default-no",
      "TransitionVersion": "",
      "Supported": false,
      "Original": "No"
    },
    {
      "Version": "9.5",
      "State": "no",
      "EvidenceKind": "yaml-default-no",
      "TransitionVersion": "",
      "Supported": false,
      "Original": "No"
    },
    {
      "Version": "9.6",
      "State": "no",
      "EvidenceKind": "yaml-default-no",
      "TransitionVersion": "",
      "Supported": false,
      "Original": "No"
    }
  ],
  "Texts": [
    {
      "Locale": "en",
      "Title": "UNIQUE NULLS NOT DISTINCT",
      "BodyHTML": "\u003cp\u003eBy default, \u003ccode\u003eNULL\u003c/code\u003e values are treated as distinct entries. Specifying \u003ccode\u003eNULLS NOT DISTINCT\u003c/code\u003e on unique indexes / constraints will cause \u003ccode\u003eNULL\u003c/code\u003e to be treated as not distinct, or in other words, equivalently.\u003c/p\u003e\n",
      "SourceHash": "1dd22bf9a7f3ec325b894e2836fda535a25529f246a94dd41d6abbfe9997f7fd",
      "ContentHash": "d065911db557a889046a1997e3f3269c2034b49698f2fe1c50aa39f8c7c5c655",
      "Payload": {
        "description": "By default, `NULL` values are treated as distinct entries. Specifying `NULLS NOT DISTINCT` on unique indexes / constraints will cause `NULL` to be treated as not distinct, or in other words, equivalently.",
        "name": "UNIQUE NULLS NOT DISTINCT",
        "versions": {
          "15": "Yes"
        }
      }
    },
    {
      "Locale": "zh-Hans",
      "Title": "UNIQUE NULLS NOT DISTINCT",
      "BodyHTML": "\u003cp\u003e默认情况下 \u003ccode\u003eNULL\u003c/code\u003e 彼此不同;在唯一索引或唯一约束上指定 \u003ccode\u003eNULLS NOT DISTINCT\u003c/code\u003e 后,\u003ccode\u003eNULL\u003c/code\u003e 会被视为不再互异。\u003c/p\u003e\n",
      "SourceHash": "071091951021357a5f492adb04caed6febf4d315ac2626ca027a48dd8ec01d50",
      "ContentHash": "c85a0851614fda0f1ba1b12de94620963b4b271c100b4dec3b4cab19737e8a33",
      "Payload": {
        "description": "默认情况下 `NULL` 彼此不同;在唯一索引或唯一约束上指定 `NULLS NOT DISTINCT` 后,`NULL` 会被视为不再互异。",
        "name": "UNIQUE NULLS NOT DISTINCT"
      }
    }
  ],
  "GroupTitles": {
    "en": "Indexing \u0026 Constraints",
    "zh-Hans": "索引和约束"
  },
  "LegacyIDs": [
    "392"
  ]
}

完整来源数据 JSON