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.
What lands in your log
ERROR: cannot pass more than 100 arguments to a function
In 10 seconds
- What triggers it
- Call a variadic function (e.g. num_nonnulls()) with 101 plain positional arguments.
- 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.
Fix
What to do right now
Application-level steps for 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.
-- Prefer one VARIADIC/array argument over a huge positional list.
SELECT num_nonnulls(VARIADIC ARRAY[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149]::int[]);For this error
See this error live on the server
Run these against the affected instance to confirm the diagnosis before you act.
54023 is a parse/catalog limit, not load pressure. Count positional arguments and redesign the call around a composite, JSON, or VARIADIC array.
Largest existing function signatures
Use pronargs to find APIs already approaching the server's argument limit.
SELECT n.nspname AS schema_name, p.proname, p.pronargs,
pg_get_function_identity_arguments(p.oid) AS identity_arguments
FROM pg_proc p
JOIN pg_namespace n ON n.oid = p.pronamespace
ORDER BY p.pronargs DESC, n.nspname, p.proname
LIMIT 20;Why it happens
What PostgreSQL is telling you
The mechanism behind the error, grounded in the official manual, not paraphrased.
PostgreSQL 16 Documentation, Preset Options, max_function_args
Reports the maximum number of function arguments. ... The default value is 100 arguments.Read the full section on postgresql.org →
The 101-argument call
Per the manual, max_function_args (default 100) is a hard, build-time-determined ceiling on positional arguments, the 101st argument alone is enough to trigger SQLSTATE 54023.Confirming the session still works
The 101-argument call was rejected at parse time before execution began, the session's next statement runs normally.Reproduce & verify
A real, single-session PostgreSQL reproduction
A literal transcript of SQL run against a live PostgreSQL instance in an isolated lab. The commands below are exactly what was executed.
- 1Call a variadic function (e.g. num_nonnulls()) with 101 plain positional arguments.
- 2SQLSTATE 54023 is reported; no value is returned.
One client: a variadic function called with one argument past the positional-argument limit.
-- No table needed: num_nonnulls() is a self-contained function call.
SELECT 'no schema required' AS setup_note;-- PostgreSQL caps the number of function arguments (SQLSTATE 54023 when exceeded).
SELECT num_nonnulls(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);
SELECT 1 AS session_still_alive;SELECT 1 AS session_still_alive;What PostgreSQL actually returned
setup_note
--------------------
no schema required
(1 row)ERROR: cannot pass more than 100 arguments to a function
LINE 1: SELECT num_nonnulls(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,...
^ session_still_alive
---------------------
1
(1 row)The deeper lab audit for this error
- Fix that hides the error but silently changes the answer: exact SQL, output, and verdict
- A manual-grounded production interpretation of the lab result
Card required. Cancel before day 7 and you are not charged.
Verification
- Last verified
- 2026-07-16 (Docker lab, PostgreSQL 16.14)
- Verification scope
- Verified against PostgreSQL 16.14 in an isolated lab environment
- Audit status
- reviewed
Went further?
Pro unlocks the second lab proof
Free page stops the bleeding. Pro adds the operational test, SQLSTATE audit, and deeper evidence, same error, more certainty.