From: | "Ian Harding" <ianh(at)tpchd(dot)org> |
---|---|
To: | <pgman(at)candle(dot)pha(dot)pa(dot)us>, <nils(at)mbit(dot)nl> |
Cc: | <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Re: PG rules! |
Date: | 2001-07-23 22:39:05 |
Message-ID: | sb5c4533.095@mail.tpchd.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Also, triggers are for when you want to be able to raise meaningful errors, right? I tend to use triggers a lot for things I could use rules for, just to catch problems and return error messages that help figure out what happened. I thought you could not do that with a rule.
Ian A. Harding
Programmer/Analyst II
Tacoma-Pierce County Health Department
(253) 798-3549
mailto: ianh(at)tpchd(dot)org
>>> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> 07/23/01 02:27PM >>>
See my book chapter at:
http://www.postgresql.org/docs/awbook.html
It discusses when to use each. Basically triggers are for modifying the
row you just inserted/updated, while Rules are for referring to other
tables.
>
>
> "Dr. Evil" wrote:
> >
> > I just want to say, that PG is an awesome thing. I'm finding new uses
> > for constraints of various kinds to ensure data integrity in my DB.
> > Constraints will really make the whole application more solid, because
> > programming errors elsewhere still won't allow corrupt data to get
> > into the DB.
>
> And I thought it was a question about rules :-) Speaking of which can
> someone tell me in which circumstances to use rules and in what
> circumstances to use triggers?
>
> Nils
> --
> Alles van waarde is weerloos
> Lucebert
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?
From | Date | Subject | |
---|---|---|---|
Next Message | Lee Harr | 2001-07-23 23:53:33 | Re: pqReadData() -- backend closed the channel unexpectedly. |
Previous Message | Ian Harding | 2001-07-23 22:32:44 | Re: Microsoft SQL Server Replication |