SQLSTATE 42P13Severity lowLab verified

Incident brief

Duplicate function parameter name

A function's named parameters must be distinct; declaring two parameters with the same name raises this invalid-function-definition error.

What lands in your log

ERROR: parameter name "a" used more than once

Reproduced on PostgreSQL 18.4Verified 2026-07-24 (isolated lab, PostgreSQL 18.4)Verified against PostgreSQL 18.4 in an isolated lab environment

In 10 seconds

What triggers it
Declare a function with two parameters that share the same name.
Fix
Give each parameter a distinct name.
Proof
Reproduced on PostgreSQL 18.4 → A CREATE FUNCTION reproduces SQLSTATE 42P13; the repeated parameter name is rejected and the LINE points at it.

Fix

What to do right now

Application-level steps for this error.

  • Give each parameter a distinct name.
  • Rename the colliding parameter so the signature is unambiguous.
Fix SQL
CREATE FUNCTION dup_param(a int, b int)
RETURNS int
LANGUAGE sql
AS 'SELECT a + b';
SELECT dup_param(1, 2);

Connected

Everything this error touches

Every page this SQLSTATE connects to: the concept that explains it, the runbooks that fix it, the parameters you tune to prevent it, and the sibling errors it travels with. All real cross-references. Jump straight in, or open the full interactive map.

Open in the interactive map →

Verification

PG 18.4
Last verified
2026-07-24 (isolated lab, PostgreSQL 18.4)
Verification scope
Verified against PostgreSQL 18.4 in an isolated lab environment
Audit status
reviewed
ShareLinkedInX

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.

FollowSubstackLinkedInnew errors · lab notes · hiring loops