From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Andrzej Mazurkiewicz <andrzej.mazurkiewicz@polkomtel.com.pl>
Cc: 'Raigo Lukk' <l950681@ttu.ee>
Cc: pgsql-general@postgreSQL.org
Cc: wieck@debis.com
Subject: Re: [GENERAL] Trigger
Date: Tue, 7 Mar 2000 09:36:02 -0500 (EST)
Message-ID: <200003071436.JAA19804@candle.pha.pa.us> (raw)
In-Reply-To: <13288F4408ADD11186FF0060B06A431303648CA2@MSGWAW1>
> Switch to v7.0 beta1 and use FOREIGN KEY. You will save a lot of time.
> Before you really finish your development there will be 7.0 production (this
> is my private estimation).
> Andrzej Mazurkiewicz
>
> > I am trying to create a trigger for a detail table to check that value
> > what is entered exists in master table.
> > For example into CustomerOrder table could not be enterd order for
> > Customer what does not exists.
Not only that he'll save some time. Without the deferred trigger
queue manager, watching that one and the same row cannot be modified
twice inside of one transaction (WRT key changes), it's possible to
fool the trigger and end up with inconsistent data in a multiuser
environment.
And don't forget that the INSERT of the FK and the DELETE of the PK
can happen simultaneously. Due to MVCC, both transactions don't
know about each other (thanks to Vadim).
Jan from Philly
--
Bruce Momjian | http://www.op.net/~candle
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: pgman@candle.pha.pa.us, andrzej.mazurkiewicz@polkomtel.com.pl, l950681@ttu.ee, wieck@debis.com
Subject: Re: [GENERAL] Trigger
In-Reply-To: <200003071436.JAA19804@candle.pha.pa.us>
References: <13288F4408ADD11186FF0060B06A431303648CA2@MSGWAW1> <200003071436.JAA19804@candle.pha.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox