22023 — invalid_parameter_value
A named parameter, option, descriptor, or function argument is outside the domain accepted by its owner. Fixed representatives cover built-in GUC parsing, amcheck descriptors/options, postgres_fdw option validation, and regular-expression option checks; the primary text identifies the owner and value.
English manual coverage begins with PostgreSQL 8.1. Source history and runtime observations have their own recorded version boundaries.
Reading PG 18·Select a recorded version
- aliases
- Unknown
- class name
- Data Exception
- condition name
- invalid_parameter_value
- lang
- en
- sqlstate
- 22023
Definition PG 18
22023
At a glance {#at-a-glance}
A named parameter, option, descriptor, or function argument is outside the domain accepted by its owner. Fixed representatives cover built-in GUC parsing, amcheck descriptors/options, postgres_fdw option validation, and regular-expression option checks; the primary text identifies the owner and value.
The retained PostgreSQL 18.6 and 10.21 observations use the same autocommit case: SET work_mem = 'not-a-memory-size' returned SQLSTATE 22023 with invalid value for parameter "work_mem": "not-a-memory-size"; SET work_mem = '1MB' repaired it and SHOW work_mem returned 1MB. Both backends were IDLE after the error and repair. The selected case is the built-in GUC path, not a general result for every 22023 owner; see the public case JSON.
SET work_mem = 'not-a-memory-size';
SET work_mem = '1MB';
SHOW work_mem;
Representative messages {#messages}
These examples share 22023 but belong to separate owners:
| Owner / path | Representative primary text |
| --- | --- |
| Built-in GUC parsing/checks | parameter "%s" requires a Boolean value; invalid value for parameter "%s": "%s" |
| verify_heapam | relation cannot be null; invalid skip option — HINT: Valid skip options are "all-visible", "all-frozen", and "none". |
| postgres_fdw | invalid value for floating point option "%s": %s; invalid value for integer option "%s": %s |
| Regular-expression option parser | invalid regular expression option: "%.*s" |
Meaning {#meaning}
22023 is a shared parameter-validation code whose mechanism belongs to the named owner. Built-in GUC parsing first converts Boolean, integer, real, string, or enum values, checks integer/real ranges and units such as B/MB or time units, then invokes parameter-specific check hooks; setting context and permissions are separate constraints. verify_heapam instead checks required non-NULL descriptors and enumerated skip values, postgres_fdw parses numeric/string options and positive bounds, and regexp functions validate option letters or function parameters. These groups share the SQLSTATE but not one universal value domain.
Diagnosis {#diagnosis}
Start with the command, function, or extension named by the primary message. For a GUC, inspect the parameter’s type, accepted units/range, and whether the current setting context permits the change; for an extension or function, follow its own option list and bounds. The exact work_mem case above demonstrates a bad GUC value and a valid unit-bearing repair only. Do not infer the repair for amcheck, postgres_fdw, regexp, or another parameter from that case.
Response {#response}
Correct the value according to the owning parameter’s documented domain, including its unit and setting context where applicable. In an explicit transaction, a statement-level ERROR requires ROLLBACK or ROLLBACK TO SAVEPOINT before continuing; an autocommit client can retry the corrected action. In the retained autocommit case the same backend remained IDLE after the error and repair.
Versions {#versions}
The locked catalogue records this condition from 7.4; fixed source coverage is PostgreSQL 18.6. The retained observation covers the named work_mem case on PostgreSQL 18.6 and 10.21.
Related {#related}
Sources {#sources}
Representative built-in GUC conversion/range/check-hook paths are src/backend/utils/misc/guc.c#L3129-3320 and #L6804-6990, with unit tables at #L87-181 and setting-context handling at #L3342-3430, alongside contrib/amcheck/verify_heapam.c#L271-303, contrib/postgres_fdw/option.c#L149-185, and src/backend/utils/adt/regexp.c#L443-446. The structured evidence record retains exact messages, runtime digests, and owner-specific limits.
Compare versions
SQLSTATE evidence and recorded runtime versions
cases · invalid_work_mem_parameter
{
"assertions": [
"SQLSTATE is 22023 with the invalid work_mem value diagnostic",
"The failed autocommit session remains IDLE",
"A valid work_mem value is accepted in the same session and SHOW reports 1MB"
],
"case_id": "invalid_work_mem_parameter",
"cleanup": "Close the runner connection and drop the case schema with an owner connection.",
"has_snippet": true,
"position": 0,
"preconditions": [
"A runner-owned disposable target is provisioned."
],
"repair": "Set work_mem to a valid memory value in the same session; do not interpret a parameter-value error as a connection failure.",
"trigger": "Set the built-in work_mem parameter to the invalid memory-size text not-a-memory-size.",
"versions": [
"10",
"18"
]
}claims · identity
{
"claim_id": "identity",
"limits": "",
"method": "Read the fixed errcodes row and macro.",
"position": 0,
"runtime": [],
"sources": [
"src.errcodes.18.6"
],
"statement": "22023 is invalid_parameter_value in SQLSTATE Class 22"
}claims · resolved-path
{
"claim_id": "resolved-path",
"limits": "Source confirmation is not a natural runtime observation.",
"method": "Read complete source contexts for the representative guards.",
"position": 1,
"runtime": [],
"sources": [
"src.amcheck",
"src.postgres_fdw",
"src.regexp.options",
"src.guc.parse",
"src.guc.hooks",
"src.guc.units",
"src.guc.context"
],
"statement": "Fixed PostgreSQL 18.6 representatives bind owner-specific NULL/option/range checks and built-in GUC parse/range/unit/context/check-hook paths."
}claims · history
{
"claim_id": "history",
"limits": "",
"method": "Use catalogue presence and history boundaries.",
"position": 2,
"runtime": [],
"sources": [
"src.errcodes.18.6"
],
"statement": "The locked catalogue records 22023 from 7.4 without proving an exact implementation introduction date."
}claims · runtime.observation
{
"claim_id": "runtime.observation",
"limits": "The observation covers the named GUC case and does not generalize to every 22023 owner.",
"method": "Read both retained summaries, raw digests, and the fixed snippet registry.",
"position": 3,
"runtime": [],
"sources": [
"runtime.22023-work-mem-latest.latest",
"runtime.22023-work-mem-pg10.pg10",
"snippet-registry.22023"
],
"statement": "The retained invalid_work_mem_parameter case passed on PostgreSQL 18.6 and 10.21 with the observed message and repair described on the page."
}messages · message.0
{
"limits": "",
"message_id": "message.0",
"path": "",
"position": 0,
"raw": {
"id": "message.0",
"primary_template": "relation cannot be null",
"severity_source": "ERROR",
"sources": [
"src.amcheck"
],
"sqlstate": "22023"
},
"severity": "ERROR",
"sources": [
"src.amcheck"
],
"templates": [
{
"kind": "primary",
"literal": "relation cannot be null",
"position": 0,
"role": "",
"template": "relation cannot be null"
}
]
}messages · message.1
{
"limits": "",
"message_id": "message.1",
"path": "",
"position": 1,
"raw": {
"id": "message.1",
"primary_template": "on_error_stop cannot be null",
"severity_source": "ERROR",
"sources": [
"src.amcheck"
],
"sqlstate": "22023"
},
"severity": "ERROR",
"sources": [
"src.amcheck"
],
"templates": [
{
"kind": "primary",
"literal": "on_error_stop cannot be null",
"position": 0,
"role": "",
"template": "on_error_stop cannot be null"
}
]
}messages · message.2
{
"limits": "",
"message_id": "message.2",
"path": "",
"position": 2,
"raw": {
"id": "message.2",
"primary_template": "check_toast cannot be null",
"severity_source": "ERROR",
"sources": [
"src.amcheck"
],
"sqlstate": "22023"
},
"severity": "ERROR",
"sources": [
"src.amcheck"
],
"templates": [
{
"kind": "primary",
"literal": "check_toast cannot be null",
"position": 0,
"role": "",
"template": "check_toast cannot be null"
}
]
}messages · message.3
{
"limits": "",
"message_id": "message.3",
"path": "",
"position": 3,
"raw": {
"id": "message.3",
"primary_template": "skip cannot be null",
"severity_source": "ERROR",
"sources": [
"src.amcheck"
],
"sqlstate": "22023"
},
"severity": "ERROR",
"sources": [
"src.amcheck"
],
"templates": [
{
"kind": "primary",
"literal": "skip cannot be null",
"position": 0,
"role": "",
"template": "skip cannot be null"
}
]
}messages · message.4
{
"limits": "",
"message_id": "message.4",
"path": "",
"position": 4,
"raw": {
"hint_template": "Valid skip options are \"all-visible\", \"all-frozen\", and \"none\".",
"id": "message.4",
"primary_template": "invalid skip option",
"severity_source": "ERROR",
"sources": [
"src.amcheck"
],
"sqlstate": "22023"
},
"severity": "ERROR",
"sources": [
"src.amcheck"
],
"templates": [
{
"kind": "primary",
"literal": "invalid skip option",
"position": 0,
"role": "",
"template": "invalid skip option"
},
{
"kind": "hint",
"literal": "Valid skip options are \"all-visible\", \"all-frozen\", and \"none\".",
"position": 1,
"role": "",
"template": "Valid skip options are \"all-visible\", \"all-frozen\", and \"none\"."
}
]
}messages · message.5
{
"limits": "",
"message_id": "message.5",
"path": "",
"position": 5,
"raw": {
"id": "message.5",
"primary_template": "invalid value for floating point option \"%s\": %s",
"severity_source": "ERROR",
"sources": [
"src.postgres_fdw"
],
"sqlstate": "22023"
},
"severity": "ERROR",
"sources": [
"src.postgres_fdw"
],
"templates": [
{
"kind": "primary",
"literal": "invalid value for floating point option \" \":",
"position": 0,
"role": "",
"template": "invalid value for floating point option \"%s\": %s"
}
]
}messages · message.6
{
"limits": "",
"message_id": "message.6",
"path": "",
"position": 6,
"raw": {
"id": "message.6",
"primary_template": "\"%s\" must be a floating point value greater than or equal to zero",
"severity_source": "ERROR",
"sources": [
"src.postgres_fdw"
],
"sqlstate": "22023"
},
"severity": "ERROR",
"sources": [
"src.postgres_fdw"
],
"templates": [
{
"kind": "primary",
"literal": "\" \" must be a floating point value greater than or equal to zero",
"position": 0,
"role": "",
"template": "\"%s\" must be a floating point value greater than or equal to zero"
}
]
}messages · message.7
{
"limits": "",
"message_id": "message.7",
"path": "",
"position": 7,
"raw": {
"id": "message.7",
"primary_template": "invalid value for integer option \"%s\": %s",
"severity_source": "ERROR",
"sources": [
"src.postgres_fdw"
],
"sqlstate": "22023"
},
"severity": "ERROR",
"sources": [
"src.postgres_fdw"
],
"templates": [
{
"kind": "primary",
"literal": "invalid value for integer option \" \":",
"position": 0,
"role": "",
"template": "invalid value for integer option \"%s\": %s"
}
]
}messages · message.8
{
"limits": "",
"message_id": "message.8",
"path": "",
"position": 8,
"raw": {
"id": "message.8",
"primary_template": "\"%s\" must be an integer value greater than zero",
"severity_source": "ERROR",
"sources": [
"src.postgres_fdw"
],
"sqlstate": "22023"
},
"severity": "ERROR",
"sources": [
"src.postgres_fdw"
],
"templates": [
{
"kind": "primary",
"literal": "\" \" must be an integer value greater than zero",
"position": 0,
"role": "",
"template": "\"%s\" must be an integer value greater than zero"
}
]
}messages · message.9
{
"limits": "",
"message_id": "message.9",
"path": "",
"position": 9,
"raw": {
"id": "message.9",
"primary_template": "invalid regular expression option: \"%.*s\"",
"severity_source": "ERROR",
"sources": [
"src.regexp.options"
],
"sqlstate": "22023"
},
"severity": "ERROR",
"sources": [
"src.regexp.options"
],
"templates": [
{
"kind": "primary",
"literal": "invalid regular expression option: \"%.*s\"",
"position": 0,
"role": "",
"template": "invalid regular expression option: \"%.*s\""
}
]
}messages · message.guc-bool
{
"limits": "",
"message_id": "message.guc-bool",
"path": "",
"position": 10,
"raw": {
"id": "message.guc-bool",
"primary_template": "parameter \"%s\" requires a Boolean value",
"severity_source": "ERROR",
"sources": [
"src.guc.parse"
],
"sqlstate": "22023"
},
"severity": "ERROR",
"sources": [
"src.guc.parse"
],
"templates": [
{
"kind": "primary",
"literal": "parameter \" \" requires a Boolean value",
"position": 0,
"role": "",
"template": "parameter \"%s\" requires a Boolean value"
}
]
}messages · message.guc-invalid
{
"limits": "",
"message_id": "message.guc-invalid",
"path": "",
"position": 11,
"raw": {
"id": "message.guc-invalid",
"primary_template": "invalid value for parameter \"%s\": \"%s\"",
"severity_source": "ERROR",
"sources": [
"src.guc.parse",
"src.guc.hooks"
],
"sqlstate": "22023"
},
"severity": "ERROR",
"sources": [
"src.guc.parse",
"src.guc.hooks"
],
"templates": [
{
"kind": "primary",
"literal": "invalid value for parameter \" \": \" \"",
"position": 0,
"role": "",
"template": "invalid value for parameter \"%s\": \"%s\""
}
]
}messages · message.guc-range-int
{
"limits": "",
"message_id": "message.guc-range-int",
"path": "",
"position": 12,
"raw": {
"id": "message.guc-range-int",
"primary_template": "%d%s%s is outside the valid range for parameter \"%s\" (%d%s%s .. %d%s%s)",
"severity_source": "ERROR",
"sources": [
"src.guc.parse"
],
"sqlstate": "22023"
},
"severity": "ERROR",
"sources": [
"src.guc.parse"
],
"templates": [
{
"kind": "primary",
"literal": "is outside the valid range for parameter \" \" ( .. )",
"position": 0,
"role": "",
"template": "%d%s%s is outside the valid range for parameter \"%s\" (%d%s%s .. %d%s%s)"
}
]
}messages · message.guc-range-real
{
"limits": "",
"message_id": "message.guc-range-real",
"path": "",
"position": 13,
"raw": {
"id": "message.guc-range-real",
"primary_template": "%g%s%s is outside the valid range for parameter \"%s\" (%g%s%s .. %g%s%s)",
"severity_source": "ERROR",
"sources": [
"src.guc.parse"
],
"sqlstate": "22023"
},
"severity": "ERROR",
"sources": [
"src.guc.parse"
],
"templates": [
{
"kind": "primary",
"literal": "is outside the valid range for parameter \" \" ( .. )",
"position": 0,
"role": "",
"template": "%g%s%s is outside the valid range for parameter \"%s\" (%g%s%s .. %g%s%s)"
}
]
}runtimes · runtime.22023-work-mem-latest.latest · 18.6 (Homebrew) · passed
{
"cases": [
"invalid_work_mem_parameter"
],
"limits": "",
"position": 0,
"raw": {
"cases": [
"invalid_work_mem_parameter"
],
"id": "runtime.22023-work-mem-latest.latest",
"observed": {
"sqlstate": "22023",
"status_after_repair": "IDLE"
},
"raw": "verify/results/22023-work-mem-latest/latest/raw.jsonl",
"raw_sha256": "932cb783e8a553f44f6edffe9668d36c82f970e200a15770f73c8447f12f7b21",
"run_id": "22023-work-mem-latest",
"server_version": "18.6 (Homebrew)",
"server_version_num": 180006,
"snippet_registry": {
"path": "verify/cases/22023/snippets.json",
"sha256": "b353a8e7365013a0c5bd27aea71353f81ad125465c825df557bb8e122ddf49ac"
},
"status": "passed",
"summary": "verify/results/22023-work-mem-latest/latest/summary.json",
"summary_sha256": "1705bbe83c899a9ce9739bf627cbcc14a17d32c39bd5ca36d11102eabb92f56f",
"target": "latest"
},
"run_id": "22023-work-mem-latest",
"runtime_id": "runtime.22023-work-mem-latest.latest",
"server_version": "18.6 (Homebrew)",
"status": "passed",
"target": "latest"
}runtimes · runtime.22023-work-mem-pg10.pg10 · 10.21 (Debian 10.21-1.pgdg90+1) · passed
{
"cases": [
"invalid_work_mem_parameter"
],
"limits": "",
"position": 1,
"raw": {
"cases": [
"invalid_work_mem_parameter"
],
"id": "runtime.22023-work-mem-pg10.pg10",
"observed": {
"sqlstate": "22023",
"status_after_repair": "IDLE"
},
"raw": "verify/results/22023-work-mem-pg10/pg10/raw.jsonl",
"raw_sha256": "f583cfbb6b8204ba5354d14e0b4808120f648668c17f1c2c2923223bdb21c313",
"run_id": "22023-work-mem-pg10",
"server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
"server_version_num": 100021,
"snippet_registry": {
"path": "verify/cases/22023/snippets.json",
"sha256": "b353a8e7365013a0c5bd27aea71353f81ad125465c825df557bb8e122ddf49ac"
},
"status": "passed",
"summary": "verify/results/22023-work-mem-pg10/pg10/summary.json",
"summary_sha256": "9c817f503bad26ec87bd09cbb3b0bf701de02fb9c2dcb14b5472d8fcb1e85509",
"target": "pg10"
},
"run_id": "22023-work-mem-pg10",
"runtime_id": "runtime.22023-work-mem-pg10.pg10",
"server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
"status": "passed",
"target": "pg10"
}sources · src.errcodes.18.6
{
"commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
"docs_url": "",
"kind": "upstream_source",
"location": "",
"path": "src/backend/utils/errcodes.txt",
"position": 0,
"sha256": "6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba",
"source_id": "src.errcodes.18.6",
"tag": "REL_18_6",
"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt#L185"
}sources · src.amcheck
{
"commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
"docs_url": "",
"kind": "upstream_source",
"location": "",
"path": "contrib/amcheck/verify_heapam.c",
"position": 1,
"sha256": "54f1452790c2f2ecca059f38221a422a91ef5d35a436e48b1b12ba393a5881eb",
"source_id": "src.amcheck",
"tag": "REL_18_6",
"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/contrib/amcheck/verify_heapam.c#L271"
}sources · src.postgres_fdw
{
"commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
"docs_url": "",
"kind": "upstream_source",
"location": "",
"path": "contrib/postgres_fdw/option.c",
"position": 2,
"sha256": "880fd16c3e5cbc56733d1292ffdcc9b0f6cb1e17e72c90e9afa4e359239dc314",
"source_id": "src.postgres_fdw",
"tag": "REL_18_6",
"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/contrib/postgres_fdw/option.c#L149"
}sources · src.regexp.options
{
"commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
"docs_url": "",
"kind": "upstream_source",
"location": "",
"path": "src/backend/utils/adt/regexp.c",
"position": 3,
"sha256": "8c54fe9e937ce03111b39da7bca89b22d6cb2de6b9ce5f7caf90c76bc7218e0e",
"source_id": "src.regexp.options",
"tag": "REL_18_6",
"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/regexp.c#L443"
}sources · src.guc.parse
{
"commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
"docs_url": "",
"kind": "upstream_source",
"location": "",
"path": "src/backend/utils/misc/guc.c",
"position": 4,
"sha256": "3021d40bb4e920a56fbc5e9452e32903a7364d7ce0aece65be70aa3c34c1274e",
"source_id": "src.guc.parse",
"tag": "REL_18_6",
"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/misc/guc.c#L3129"
}sources · src.guc.hooks
{
"commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
"docs_url": "",
"kind": "upstream_source",
"location": "",
"path": "src/backend/utils/misc/guc.c",
"position": 5,
"sha256": "3021d40bb4e920a56fbc5e9452e32903a7364d7ce0aece65be70aa3c34c1274e",
"source_id": "src.guc.hooks",
"tag": "REL_18_6",
"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/misc/guc.c#L6804"
}sources · snippet-registry.22023
{
"commit": "",
"docs_url": "",
"kind": "local_artifact",
"location": "",
"path": "verify/cases/22023/snippets.json",
"position": 6,
"sha256": "b353a8e7365013a0c5bd27aea71353f81ad125465c825df557bb8e122ddf49ac",
"source_id": "snippet-registry.22023",
"tag": "",
"url": ""
}sources · src.guc.units
{
"commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
"docs_url": "",
"kind": "upstream_source",
"location": "",
"path": "src/backend/utils/misc/guc.c",
"position": 7,
"sha256": "3021d40bb4e920a56fbc5e9452e32903a7364d7ce0aece65be70aa3c34c1274e",
"source_id": "src.guc.units",
"tag": "REL_18_6",
"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/misc/guc.c#L87"
}sources · src.guc.context
{
"commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
"docs_url": "",
"kind": "upstream_source",
"location": "",
"path": "src/backend/utils/misc/guc.c",
"position": 8,
"sha256": "3021d40bb4e920a56fbc5e9452e32903a7364d7ce0aece65be70aa3c34c1274e",
"source_id": "src.guc.context",
"tag": "REL_18_6",
"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/misc/guc.c#L3342"
}Source references
Full definition and evidence JSON
Definition sources
center · PostgreSQL 18 · english-manuals:88568757f333674973c9543e722b35a83acfb0e2013ba72285a041a497c14818
Text language: en · english-manuals:88568757f333674973c9543e722b35a83acfb0e2013ba72285a041a497c14818