SQLSTATE 42723Severity lowLab verified

Incident brief

Duplicate function

CREATE FUNCTION fails when a function with the same name and argument types already exists; CREATE OR REPLACE updates it instead of colliding.

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
What triggers it
CREATE FUNCTION with a name and argument-type list that already exists.
The fix
Use CREATE OR REPLACE FUNCTION to update the existing definition.
Proof
Reproduced on PostgreSQL 18.4 → A CREATE FUNCTION reproduces SQLSTATE 42723 against the existing same-signature function.

The fix

What to do right now

The immediate, application-level response to this error.

  • Use CREATE OR REPLACE FUNCTION to update the existing definition.
  • Or change the argument types to define a genuinely different overload.
Fix — SQL
-- Update in place with CREATE OR REPLACE FUNCTION.
CREATE OR REPLACE FUNCTION add_one(int) RETURNS int LANGUAGE sql AS 'SELECT $1 + 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