Dmitry Teslenko wrote:
> These solution work and enforce data integrity as needed. Sadly, database
> interface I use (Trolltech Qt 3) can't track when trigger aborts
> update or insert. Can I raise exception in trigger or something?
RAISE EXCEPTION 'Failed to update mytable: date range (%,%) overlaps an
existing entry', NEW.from_dt, NEW.to_dt;
You can also do RAISE NOTICE, WARNING etc. See the pl/pgsql section of
the manual for details.
In response to
pgsql-general by date
|Next:||From: hubert depesz lubaczewski||Date: 2008-07-29 10:42:30|
|Subject: Re: Right way to reject INSERTs and UPDATEs|
|Previous:||From: Dmitry Teslenko||Date: 2008-07-29 10:25:21|
|Subject: Right way to reject INSERTs and UPDATEs|