Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: error handling



On Thu, Apr 27, 2006 at 15:29:07 +0200,
  Verena Ruff <lists(at)triosolutions(dot)at> wrote:
> Hello,
> 
> I have a table with an UNIQUE constraint. Is it possible to have 
> something like a trigger (or error handler) which is called every time  
> a insert statement would break this constraint?  Or in some simple cases 
> that this record is just dropped silently, without reporting an error?

Unique constraints are not deferrable in Postgres. It would be possible to
have a function do the insert and trap errors. I don't know if that will
help in your situation though.



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group