Re: Triggers do the error checking

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Janning Vygen <vygen(at)planwerk6(dot)de>
Cc: PostgreSQL-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Triggers do the error checking
Date: 2001-06-29 12:31:56
Message-ID: 200106291231.f5TCVuk23367@jupiter.us.greatbridge.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Janning Vygen wrote:
> Hi,
>
> i am new to the concepts of SQL and Postgresql.
> i am just thinking about some database design decisions.
>
> at this time my tabel has many trigger functions to check the inserted or
> updated values.
>
> Some checks could be done via a check constraint, but i wont get individual
> error-messages. With triggers i can raise exceptions in a different language
> which my php frontend can show to the user.
>
> So the whole error checking is done inside the database with triggers.
>
> Is this ok? or is it a bad design decision. I dont want my frontend(gui, php
> site) to do the error checking because i dont want to write things a thousand
> times.

You answered the question already. And in addition, doing it
with triggers inside the database guarantees you can never
forget the check. The worst thing that can happen is that the
frontend doesn't catch the ERROR and looks a little puzzled.
But your data is safe.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message tamsin 2001-06-29 12:40:04 RE:
Previous Message fabrizio.ermini 2001-06-29 10:11:22 A quick SUSE question...