PHP Handling Errors - Mailing list pgsql-novice

From Mag Gam
Subject PHP Handling Errors
Date
Msg-id 1cbd6f830510301521u6348ebb8j137ee1f4b1a5f2b5@mail.gmail.com
Whole thread Raw
List pgsql-novice
Using PHP I get this message when trying to against my UNIQUE constraint.

Warning: pg_query(): Query failed: ERROR: duplicate key violates
unique constraint "category_name_key" in foo.php on line 12

Instead of this message, I would like something like this:

a popup button comes up and says, "This already exists". I guess I can
use Java script or something.

But is it possible to write a sql function to handle this?

TIA!

pgsql-novice by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Route to backend
Next
From: "Christian Hofmann"
Date:
Subject: PL/pgSQL Trigger - Variable for shema? Like TG_RELNAME