PostgreSQL error code
PostgreSQL error 42723
42723 is the SQLSTATE PostgreSQL reports for duplicate function, in class 42, Syntax Error or Access Rule Violation.
| SQLSTATE | 42723 |
|---|---|
| Condition name | duplicate_function |
| Class | 42 — Syntax Error or Access Rule Violation |
Reproduce it, then fix it
A function with that name and those argument types already exists. CREATE OR REPLACE swaps in the new body. Run the broken query to see the error, then switch to the fixed one. Edit either freely; every run is rolled back.
CREATE FUNCTION tax_rate() RETURNS numeric AS 'SELECT 0.20' LANGUAGE sql; CREATE FUNCTION tax_rate() RETURNS numeric AS 'SELECT 0.19' LANGUAGE sql;
CREATE FUNCTION tax_rate() RETURNS numeric AS 'SELECT 0.20' LANGUAGE sql; CREATE OR REPLACE FUNCTION tax_rate() RETURNS numeric AS 'SELECT 0.19' LANGUAGE sql; SELECT tax_rate();