↑↓ select↵ open⌫ change scopeOpen full search

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

Wiki / SQLSTATE

54023 \u2014 too_many_arguments

54023 is the argument-count limit for functions, procedures, aggregates, and set-returning calls. Fixed paths protect catalog arrays, parser nodes, and executor FunctionCallInfo storage, and report the actual compile-time limit with plural-aware messages.

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
Program Limit Exceeded
condition name
too_many_arguments
lang
en
sqlstate
54023

Definition PG 18

54023

At a glance {#at-a-glance}

54023 is the argument-count limit for functions, procedures, aggregates, and set-returning calls. Fixed paths protect catalog arrays, parser nodes, and executor FunctionCallInfo storage, and report the actual compile-time limit with plural-aware messages.

Meaning {#meaning}

The fixed build defines FUNC_MAX_ARGS as 100 in pg_config_manual.h; the source notes a practical upper bound near 600 and requires a full backend (including C functions) recompile if it changes. Function definitions count input parameters and explicitly do not count output arguments. Aggregate definitions and aggregate calls use FUNC_MAX_ARGS - 1 so transition/final functions remain representable. Procedure/function parser and executor guards cover explicit arguments plus default arguments, SRFs, and stored window expressions. The caller and object kind determine the repair.

Messages {#messages}

| Source path | Exact primary template (singular / plural) | Count passed to %d | | --- | --- | --- | | pg_proc.c function definition | functions cannot have more than %d argument / functions cannot have more than %d arguments | Compare parameterCount (the input-parameter array length; output parameters are excluded) with FUNC_MAX_ARGS; %d receives FUNC_MAX_ARGS (100) | | functioncmds.c procedure call | cannot pass more than %d argument to a procedure / cannot pass more than %d arguments to a procedure | Compare nargs = list_length(fexpr->args) with FUNC_MAX_ARGS; %d receives FUNC_MAX_ARGS | | parse_func.c, execExpr.c, execSRF.c, and nodeWindowAgg.c function/SRF/window call | cannot pass more than %d argument to a function / cannot pass more than %d arguments to a function | Compare list_length(fargs), nargs, list_length(sexpr->args), or perfuncstate->numArguments with FUNC_MAX_ARGS; %d receives FUNC_MAX_ARGS | | pg_aggregate.c aggregate definition/call | aggregates cannot have more than %d argument / aggregates cannot have more than %d arguments | Compare numArgs with FUNC_MAX_ARGS - 1; %d receives 99, leaving a slot for transition/final functions |

These are errmsg_plural groups, so clients should preserve the server's singular/plural rendering and the reported limit instead of searching only for one hand-written string.

Diagnosis {#diagnosis}

Record whether the failure is CREATE/definition time or invocation time, and whether the object is a function, procedure, aggregate, SRF, or window aggregate. Count explicit arguments and parser-expanded defaults; for an aggregate use the stricter FUNC_MAX_ARGS - 1 boundary. Preserve the exact singular/plural primary and maximum from the message, and check whether a stored view/plan was made by a binary with a different FUNC_MAX_ARGS.

Response {#response}

Reduce the argument list, group related values into a composite or documented record type, or redesign the function boundary. For a procedure or aggregate definition, change the signature and dependent callers together; do not silently drop arguments, count output arguments as inputs, or assume aggregate and ordinary-function calls share the same limit. Changing FUNC_MAX_ARGS is a build-wide compatibility decision, not a session setting. If an ERROR occurs inside an explicit transaction, use ROLLBACK or ROLLBACK TO SAVEPOINT before retrying; in autocommit, retry only after the definition or call has been changed to fit the fixed count.

Versions {#versions}

The locked catalogue records this condition from 7.4; cited macro, catalog, parser, executor, aggregate, and SRF paths are PostgreSQL 18.6 source. No oversized signature or call was created.

Related {#related}

54011, 54000, 42883

Sources {#sources}

src/backend/catalog/pg_proc.c#L156-L161

src/backend/commands/functioncmds.c#L2261-L2266

src/backend/executor/execExpr.c#L2727-L2732

src/backend/executor/execSRF.c#L716-L721

src/include/pg_config_manual.h#L31-L43

src/backend/catalog/pg_aggregate.c#L121-L132

src/backend/parser/parse_func.c#L129-L142

src/backend/executor/nodeWindowAgg.c#L1042-L1054

The structured evidence record records fixed messages and the source/runtime boundary.

Compare versions

SQLSTATE evidence and recorded runtime versions

claims · identity
{
  "claim_id": "identity",
  "limits": "",
  "method": "Read fixed definition.",
  "position": 0,
  "runtime": [],
  "sources": [
    "src.errcodes.18.6"
  ],
  "statement": "54023 is too_many_arguments in SQLSTATE Class 54."
}
claims · resolved-paths
{
  "claim_id": "resolved-paths",
  "limits": "Source confirmation is not natural runtime.",
  "method": "Read complete fixed source contexts.",
  "position": 1,
  "runtime": [],
  "sources": [
    "src.path.0",
    "src.path.1",
    "src.path.2",
    "src.path.3",
    "src.path.4",
    "src.path.5",
    "src.path.6",
    "src.path.7"
  ],
  "statement": "The cited PostgreSQL 18.6 source paths support the representative resource and object-state mechanisms described."
}
claims · compile-time-limit
{
  "claim_id": "compile-time-limit",
  "limits": "",
  "method": "Read the fixed macro, aggregate, parser, and executor guards.",
  "position": 2,
  "runtime": [],
  "sources": [
    "src.path.4",
    "src.path.5",
    "src.path.6",
    "src.path.7"
  ],
  "statement": "FUNC_MAX_ARGS is a compile-time constant of 100 in the fixed PG18.6 header; aggregate definitions/calls use one fewer argument, and parser/executor guards protect calls including stored expressions."
}
claims · raw-message-roles
{
  "claim_id": "raw-message-roles",
  "limits": "",
  "method": "Read source-call report groups alongside complete fixed files.",
  "position": 3,
  "runtime": [],
  "sources": [
    "src.calls.REL_18_6"
  ],
  "statement": "The fixed report groups use errmsg_plural with singular and plural format_raw strings and pass FUNC_MAX_ARGS (or FUNC_MAX_ARGS - 1 for aggregates); the scan preserves the macro call rather than only a flattened message."
}
claims · history
{
  "claim_id": "history",
  "limits": "",
  "method": "Use catalogue boundary.",
  "position": 4,
  "runtime": [],
  "sources": [
    "src.errcodes.18.6"
  ],
  "statement": "The locked catalogue records 54023 from 7.4; that boundary does not prove exact implementation introduction."
}
messages · message.0
{
  "limits": "",
  "message_id": "message.0",
  "path": "",
  "position": 0,
  "raw": {
    "id": "message.0",
    "primary_template_plural": "functions cannot have more than %d arguments",
    "primary_template_singular": "functions cannot have more than %d argument",
    "severity_source": "ERROR",
    "sources": [
      "src.path.0"
    ],
    "sqlstate": "54023",
    "template_type": "plural"
  },
  "severity": "ERROR",
  "sources": [
    "src.path.0"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "functions cannot have more than argument",
      "position": 0,
      "role": "singular",
      "template": "functions cannot have more than %d argument"
    },
    {
      "kind": "primary",
      "literal": "functions cannot have more than arguments",
      "position": 1,
      "role": "plural",
      "template": "functions cannot have more than %d arguments"
    }
  ]
}
messages · message.1
{
  "limits": "",
  "message_id": "message.1",
  "path": "",
  "position": 1,
  "raw": {
    "id": "message.1",
    "primary_template_plural": "cannot pass more than %d arguments to a procedure",
    "primary_template_singular": "cannot pass more than %d argument to a procedure",
    "severity_source": "ERROR",
    "sources": [
      "src.path.1"
    ],
    "sqlstate": "54023",
    "template_type": "plural"
  },
  "severity": "ERROR",
  "sources": [
    "src.path.1"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "cannot pass more than argument to a procedure",
      "position": 0,
      "role": "singular",
      "template": "cannot pass more than %d argument to a procedure"
    },
    {
      "kind": "primary",
      "literal": "cannot pass more than arguments to a procedure",
      "position": 1,
      "role": "plural",
      "template": "cannot pass more than %d arguments to a procedure"
    }
  ]
}
messages · message.2
{
  "limits": "",
  "message_id": "message.2",
  "path": "",
  "position": 2,
  "raw": {
    "id": "message.2",
    "primary_template_plural": "cannot pass more than %d arguments to a function",
    "primary_template_singular": "cannot pass more than %d argument to a function",
    "severity_source": "ERROR",
    "sources": [
      "src.path.2"
    ],
    "sqlstate": "54023",
    "template_type": "plural"
  },
  "severity": "ERROR",
  "sources": [
    "src.path.2"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "cannot pass more than argument to a function",
      "position": 0,
      "role": "singular",
      "template": "cannot pass more than %d argument to a function"
    },
    {
      "kind": "primary",
      "literal": "cannot pass more than arguments to a function",
      "position": 1,
      "role": "plural",
      "template": "cannot pass more than %d arguments to a function"
    }
  ]
}
messages · message.3
{
  "limits": "",
  "message_id": "message.3",
  "path": "",
  "position": 3,
  "raw": {
    "id": "message.3",
    "primary_template_plural": "cannot pass more than %d arguments to a function",
    "primary_template_singular": "cannot pass more than %d argument to a function",
    "severity_source": "ERROR",
    "sources": [
      "src.path.3"
    ],
    "sqlstate": "54023",
    "template_type": "plural"
  },
  "severity": "ERROR",
  "sources": [
    "src.path.3"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "cannot pass more than argument to a function",
      "position": 0,
      "role": "singular",
      "template": "cannot pass more than %d argument to a function"
    },
    {
      "kind": "primary",
      "literal": "cannot pass more than arguments to a function",
      "position": 1,
      "role": "plural",
      "template": "cannot pass more than %d arguments to a function"
    }
  ]
}
messages · message.4
{
  "limits": "",
  "message_id": "message.4",
  "path": "",
  "position": 4,
  "raw": {
    "id": "message.4",
    "primary_template_plural": "aggregates cannot have more than %d arguments",
    "primary_template_singular": "aggregates cannot have more than %d argument",
    "severity_source": "ERROR",
    "sources": [
      "src.path.5"
    ],
    "sqlstate": "54023",
    "template_type": "plural"
  },
  "severity": "ERROR",
  "sources": [
    "src.path.5"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "aggregates cannot have more than argument",
      "position": 0,
      "role": "singular",
      "template": "aggregates cannot have more than %d argument"
    },
    {
      "kind": "primary",
      "literal": "aggregates cannot have more than arguments",
      "position": 1,
      "role": "plural",
      "template": "aggregates cannot have more than %d arguments"
    }
  ]
}
messages · message.5
{
  "limits": "",
  "message_id": "message.5",
  "path": "",
  "position": 5,
  "raw": {
    "id": "message.5",
    "primary_template_plural": "cannot pass more than %d arguments to a function",
    "primary_template_singular": "cannot pass more than %d argument to a function",
    "severity_source": "ERROR",
    "sources": [
      "src.path.7"
    ],
    "sqlstate": "54023",
    "template_type": "plural"
  },
  "severity": "ERROR",
  "sources": [
    "src.path.7"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "cannot pass more than argument to a function",
      "position": 0,
      "role": "singular",
      "template": "cannot pass more than %d argument to a function"
    },
    {
      "kind": "primary",
      "literal": "cannot pass more than arguments to a function",
      "position": 1,
      "role": "plural",
      "template": "cannot pass more than %d arguments to a function"
    }
  ]
}
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#L419"
}
sources · src.path.0
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/catalog/pg_proc.c",
  "position": 1,
  "sha256": "77a883995e5fadf17fae68722043beb43115e685e8082b2b7256d92312528a5a",
  "source_id": "src.path.0",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/catalog/pg_proc.c#L156"
}
sources · src.path.1
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/commands/functioncmds.c",
  "position": 2,
  "sha256": "33de4dd569d9b8b93ca3efbba4b31726af79f2864110454a7d7cdf286b3647aa",
  "source_id": "src.path.1",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/commands/functioncmds.c#L2261"
}
sources · src.path.2
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/executor/execExpr.c",
  "position": 3,
  "sha256": "9bc3aa2562686b1860005137de9611e56ff6b41eaf9b3eefd9c3f058dc057431",
  "source_id": "src.path.2",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/executor/execExpr.c#L2727"
}
sources · src.path.3
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/executor/execSRF.c",
  "position": 4,
  "sha256": "5c6038cbcc254113a39119af636331063b11d75ad7757b027620d78ed1ecdf2a",
  "source_id": "src.path.3",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/executor/execSRF.c#L716"
}
sources · src.path.4
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/include/pg_config_manual.h",
  "position": 5,
  "sha256": "3b513dda5408337ef7c31bca491844650b4ea2cdb1b688d6b99ab74ba3f06700",
  "source_id": "src.path.4",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/include/pg_config_manual.h#L31"
}
sources · src.path.5
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/catalog/pg_aggregate.c",
  "position": 6,
  "sha256": "75c08cdd82917e45647f7c523c9ad8fb49423c89f13e26754be1e37e4c6a49b4",
  "source_id": "src.path.5",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/catalog/pg_aggregate.c#L121"
}
sources · src.path.6
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/parser/parse_func.c",
  "position": 7,
  "sha256": "48314eab022297478ac4e49786afaff2621ab7b1d7b50e156668cf477961384f",
  "source_id": "src.path.6",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/parser/parse_func.c#L129"
}
sources · src.path.7
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/executor/nodeWindowAgg.c",
  "position": 8,
  "sha256": "c365e6750bc77a89562254903d099c3e5914e001d3aae418322ccffc1d535d17",
  "source_id": "src.path.7",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/executor/nodeWindowAgg.c#L1042"
}
sources · src.calls.REL_18_6
{
  "commit": "",
  "docs_url": "",
  "kind": "local_artifact",
  "location": "",
  "path": "raw/calls/REL_18_6.jsonl",
  "position": 9,
  "sha256": "9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf",
  "source_id": "src.calls.REL_18_6",
  "tag": "REL_18_6",
  "url": ""
}

Source references

Full definition and evidence JSON

Definition sources

center · PostgreSQL 18 · english-manuals:e244919789a20729855242fb689e77d74f54a8535443b7ea929c03dd8bd8f6f0

Text language: en · english-manuals:e244919789a20729855242fb689e77d74f54a8535443b7ea929c03dd8bd8f6f0