PHP Handling Errors

From: Mag Gam <magawake(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: PHP Handling Errors
Date: 2005-10-30 23:21:28
Message-ID: 1cbd6f830510301521u6348ebb8j137ee1f4b1a5f2b5@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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!

Browse pgsql-novice by date

  From Date Subject
Next Message Christian Hofmann 2005-10-31 09:47:50 PL/pgSQL Trigger - Variable for shema? Like TG_RELNAME
Previous Message Michael Fuhr 2005-10-29 02:14:52 Re: Route to backend