↑↓ select↵ open⌫ change scopeOpen full search

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

Wiki / Versions

BEGIN ATOMIC function bodies

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.

Custom Functions, Stored Procedures, & Triggers

Description

PostgreSQL functions and stored procedures can now be created using the SQL-standard BEGIN ATOMIC definition. Using BEGIN ATOMIC allows function bodies to be parsed on creation and also provides dependency. For example:

CREATE FUNCTION add(int, int)
RETURNS int
IMMUTABLE PARALLEL SAFE
BEGIN ATOMIC;
  SELECT $1 + $2;
END;

Selected version: PostgreSQL 18

Yes

20191817161514131211109.69.59.49.39.29.19.08.48.38.28.18.07.4
UnknownUnknownYesYesYesYesYesNoNoNoNoNoNoNoNoNoNoNoNoNoNoNoUnknownUnknown

Compare versions

Original documentation links

Recorded legacy identifiers: 393

Complete source facts and provenance

yaml · center · 1dd22bf9a7f3ec325b894e2836fda535a25529f246a94dd41d6abbfe9997f7fd

{
  "Key": "begin-atomic-function-bodies",
  "SourceKind": "yaml",
  "SourceDatabase": "center",
  "SourceTable": "featurematrix.yaml",
  "SourceKey": "BEGIN ATOMIC function bodies",
  "SourceHash": "1dd22bf9a7f3ec325b894e2836fda535a25529f246a94dd41d6abbfe9997f7fd",
  "Name": "BEGIN ATOMIC function bodies",
  "NameLocale": "en",
  "GroupKey": "custom-functions-stored-procedures-triggers",
  "GroupName": "Custom Functions, Stored Procedures, \u0026 Triggers",
  "GroupLocale": "en",
  "Ordinal": 2,
  "GroupOrder": 18,
  "Facts": {
    "feature": {
      "description": "PostgreSQL functions and stored procedures can now be created using the SQL-standard `BEGIN ATOMIC` definition. Using `BEGIN ATOMIC` allows function bodies to be parsed on creation and also provides dependency. For example:\r\n\r\n```\r\nCREATE FUNCTION add(int, int)\r\nRETURNS int\r\nIMMUTABLE PARALLEL SAFE\r\nBEGIN ATOMIC;\r\n  SELECT $1 + $2;\r\nEND;\r\n```",
      "name": "BEGIN ATOMIC function bodies",
      "versions": {
        "14": "Yes"
      }
    },
    "group": "Custom Functions, Stored Procedures, \u0026 Triggers",
    "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": "yes",
      "EvidenceKind": "yaml-transition",
      "TransitionVersion": "14",
      "Supported": true,
      "Original": "Yes"
    },
    {
      "Version": "15",
      "State": "yes",
      "EvidenceKind": "yaml-transition",
      "TransitionVersion": "14",
      "Supported": true,
      "Original": "Yes"
    },
    {
      "Version": "16",
      "State": "yes",
      "EvidenceKind": "yaml-transition",
      "TransitionVersion": "14",
      "Supported": true,
      "Original": "Yes"
    },
    {
      "Version": "17",
      "State": "yes",
      "EvidenceKind": "yaml-transition",
      "TransitionVersion": "14",
      "Supported": true,
      "Original": "Yes"
    },
    {
      "Version": "18",
      "State": "yes",
      "EvidenceKind": "yaml-transition",
      "TransitionVersion": "14",
      "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": "BEGIN ATOMIC function bodies",
      "BodyHTML": "\u003cp\u003ePostgreSQL functions and stored procedures can now be created using the SQL-standard \u003ccode\u003eBEGIN ATOMIC\u003c/code\u003e definition. Using \u003ccode\u003eBEGIN ATOMIC\u003c/code\u003e allows function bodies to be parsed on creation and also provides dependency. For example:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003eCREATE FUNCTION add(int, int)\nRETURNS int\nIMMUTABLE PARALLEL SAFE\nBEGIN ATOMIC;\n  SELECT $1 + $2;\nEND;\n\u003c/code\u003e\u003c/pre\u003e\n",
      "SourceHash": "1dd22bf9a7f3ec325b894e2836fda535a25529f246a94dd41d6abbfe9997f7fd",
      "ContentHash": "902637e6645ceaeff9a5ccb3bc1ab2d57efc12d7beb1fd6a75ebb4429281c0ed",
      "Payload": {
        "description": "PostgreSQL functions and stored procedures can now be created using the SQL-standard `BEGIN ATOMIC` definition. Using `BEGIN ATOMIC` allows function bodies to be parsed on creation and also provides dependency. For example:\r\n\r\n```\r\nCREATE FUNCTION add(int, int)\r\nRETURNS int\r\nIMMUTABLE PARALLEL SAFE\r\nBEGIN ATOMIC;\r\n  SELECT $1 + $2;\r\nEND;\r\n```",
        "name": "BEGIN ATOMIC function bodies",
        "versions": {
          "14": "Yes"
        }
      }
    },
    {
      "Locale": "zh-Hans",
      "Title": "BEGIN ATOMIC 函数体",
      "BodyHTML": "\u003cp\u003ePostgreSQL 函数和存储过程现在可以使用 SQL 标准的 \u003ccode\u003eBEGIN ATOMIC\u003c/code\u003e 语法定义函数体。\u003c/p\u003e\n",
      "SourceHash": "071091951021357a5f492adb04caed6febf4d315ac2626ca027a48dd8ec01d50",
      "ContentHash": "fe3fcf1eb2f8d5799f81303d8b22185ce0ed9cf4663841de68dc56f07276098b",
      "Payload": {
        "description": "PostgreSQL 函数和存储过程现在可以使用 SQL 标准的 `BEGIN ATOMIC` 语法定义函数体。",
        "name": "BEGIN ATOMIC 函数体"
      }
    }
  ],
  "GroupTitles": {
    "en": "Custom Functions, Stored Procedures, \u0026 Triggers",
    "zh-Hans": "自定义函数、存储过程和触发器"
  },
  "LegacyIDs": [
    "393"
  ]
}

Complete source data JSON