SQLSTATE 54023Severity lowLab verified

Incident brief

Too many function arguments

A function was called with more positional arguments than PostgreSQL allows in a single call. PostgreSQL rejected the call at parse time.

Reproduced on PostgreSQL 16.14Verified 2026-07-16 (Docker lab, PostgreSQL 16.14)Reviewed by Verified against PostgreSQL 16.14 in an isolated lab environment

In 10 seconds

What
Too many function arguments
What triggers it
Call a variadic function (e.g. num_nonnulls()) with 101 plain positional arguments.
The fix
Pass the values inside a single VARIADIC array argument instead of as separate positional arguments — the array only counts as one argument no matter how many elements it holds.
Proof
Reproduced on PostgreSQL 16.14 → num_nonnulls() called with 101 plain positional arguments was rejected with SQLSTATE 54023, one past the 100-argument limit.

The fix

What to do right now

The immediate, application-level response to this error.

  • Pass the values inside a single VARIADIC array argument instead of as separate positional arguments — the array only counts as one argument no matter how many elements it holds.
  • Don't just drop an argument to get back under the limit — see the premium counterexample for how that can silently change the answer.
Fix — SQL
-- Example direction: replace 150 positional arguments with one VARIADIC array argument.
SELECT num_nonnulls(VARIADIC ARRAY[/* ...150 values... */]);

Related & next steps

Follow the thread

Everything this error touches — jump straight to the sibling error, term, runbook, or parameter.

Verification

PG 16.14
Last verified
2026-07-16 (Docker lab, PostgreSQL 16.14)
Reviewed by
Verified against PostgreSQL 16.14 in an isolated lab environment
Audit status
reviewed