↑↓ select↵ open⌫ change scopeOpen full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Wiki / Versions

MERGE ... RETURNING

Recorded source states and original language descriptions. Missing version evidence stays unknown.

The source snapshot records transitions for PostgreSQL 8.1–18. The historical matrix records independent cells for 7.4–18. Neither records support for PostgreSQL 19 or 20; newer versions remain unknown. These source claims are distinct from runtime measurements.

SQL

Description

MERGE can now use a RETURNING clause to return modified rows and what action was used to modify them using the merge_action() function.

Selected version: PostgreSQL 18

Yes

20191817161514131211109.69.59.49.39.29.19.08.48.38.28.18.07.4
UnknownUnknownYesYesNoNoNoNoNoNoNoNoNoNoNoNoNoNoNoNoNoNoUnknownUnknown

Compare versions

Original documentation links

Recorded legacy identifiers: 425

Complete source facts and provenance

yaml · center · 1dd22bf9a7f3ec325b894e2836fda535a25529f246a94dd41d6abbfe9997f7fd

{
  "Key": "merge-returning",
  "SourceKind": "yaml",
  "SourceDatabase": "center",
  "SourceTable": "featurematrix.yaml",
  "SourceKey": "MERGE ... RETURNING",
  "SourceHash": "1dd22bf9a7f3ec325b894e2836fda535a25529f246a94dd41d6abbfe9997f7fd",
  "Name": "MERGE ... RETURNING",
  "NameLocale": "en",
  "GroupKey": "sql",
  "GroupName": "SQL",
  "GroupLocale": "en",
  "Ordinal": 6,
  "GroupOrder": 3,
  "Facts": {
    "feature": {
      "description": "[MERGE](https://www.postgresql.org/docs/current/sql-merge.html) can now use a `RETURNING` clause to return modified rows and what action was used to modify them using the `merge_action()` function.",
      "name": "MERGE ... RETURNING",
      "versions": {
        "17": "Yes"
      }
    },
    "group": "SQL",
    "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": "no",
      "EvidenceKind": "yaml-default-no",
      "TransitionVersion": "",
      "Supported": false,
      "Original": "No"
    },
    {
      "Version": "16",
      "State": "no",
      "EvidenceKind": "yaml-default-no",
      "TransitionVersion": "",
      "Supported": false,
      "Original": "No"
    },
    {
      "Version": "17",
      "State": "yes",
      "EvidenceKind": "yaml-transition",
      "TransitionVersion": "17",
      "Supported": true,
      "Original": "Yes"
    },
    {
      "Version": "18",
      "State": "yes",
      "EvidenceKind": "yaml-transition",
      "TransitionVersion": "17",
      "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": "MERGE ... RETURNING",
      "BodyHTML": "\u003cp\u003e\u003ca href=\"https://www.postgresql.org/docs/current/sql-merge.html\" rel=\"nofollow\"\u003eMERGE\u003c/a\u003e can now use a \u003ccode\u003eRETURNING\u003c/code\u003e clause to return modified rows and what action was used to modify them using the \u003ccode\u003emerge_action()\u003c/code\u003e function.\u003c/p\u003e\n",
      "SourceHash": "1dd22bf9a7f3ec325b894e2836fda535a25529f246a94dd41d6abbfe9997f7fd",
      "ContentHash": "c866b74ab878676e447d85bbd11ec0bbb3f7b56edb972bde89865432aa0b8f8a",
      "Payload": {
        "description": "[MERGE](https://www.postgresql.org/docs/current/sql-merge.html) can now use a `RETURNING` clause to return modified rows and what action was used to modify them using the `merge_action()` function.",
        "name": "MERGE ... RETURNING",
        "versions": {
          "17": "Yes"
        }
      }
    },
    {
      "Locale": "zh-Hans",
      "Title": "MERGE ... RETURNING",
      "BodyHTML": "\u003cp\u003e\u003ccode\u003eMERGE\u003c/code\u003e 现在可以使用 \u003ccode\u003eRETURNING\u003c/code\u003e 子句返回被修改的行以及实际执行的动作。\u003c/p\u003e\n",
      "SourceHash": "071091951021357a5f492adb04caed6febf4d315ac2626ca027a48dd8ec01d50",
      "ContentHash": "6951749be85229b78d27391f6f656b4c1d33edec932d15fc00841a6ab457e1a0",
      "Payload": {
        "description": "`MERGE` 现在可以使用 `RETURNING` 子句返回被修改的行以及实际执行的动作。",
        "name": "MERGE ... RETURNING"
      }
    }
  ],
  "GroupTitles": {
    "en": "SQL",
    "zh-Hans": "SQL"
  },
  "LegacyIDs": [
    "425"
  ]
}

Complete source data JSON