Search Postgresql Archives

Re: regarding triggers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/10/06, John McCawley <nospam@xxxxxxxxxxxx> wrote:
> Regarding the usefulness of triggers...I tend to stay away from them.  I
> like to keep my data in my database and my logic in my application.  I
> try to relegate triggers to very simple things like timestamping
> records.  i.e. things that I won't later wonder "What in the hell is
> going on???"

I always try to get all the relationships from the data into the
database using whatever the database can do ie triggers, foriegn keys,
check constraints etc. I find that leaving all the logic to the
application is a disaster waiting to happen particularly when the
application is being developed by lots of people.

If you insist in having all the logic in the application then surely
you could use triggers to make sure that if the application makes a
cock up then the integrity of the data won't be compromised. I know
you can use "begin;  commit;" from the application but when working
with other developers there are no guarantees that they will always be
using them or more likely a mistake will be made by me or someone else
and I want the database to handle it.

--
Harry
http://www.hjackson.org
http://www.uklug.co.uk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux