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.

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

In 10 seconds

What
Duplicate function parameter name
What triggers it
Declare a function with two parameters that share the same name.
The 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.

The fix

What to do right now

The immediate, application-level response to this error.

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

Related & next steps

Follow the thread

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

Verification

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