Re: Trigger question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Harald Fuchs <hf118(at)protecting(dot)net>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Trigger question
Date: 2004-01-20 16:42:30
Message-ID: 24605.1074616950@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Harald Fuchs <hf118(at)protecting(dot)net> writes:
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>> I'm not very clear on
>> how that works myself --- in particular, one would think it important to
>> be able to work with corresponding pairs of OLD and NEW rows, which
>> would be painful with a table-like abstraction.

> Why? If the underlying table has a primary key, finding corresponding
> pairs is trivial; if there isn't, it's impossible.

Exactly. Nonetheless, the correspondence exists --- the UPDATE
definitely updated some particular row of the OLD set into some
particular one of the NEW set. If the trigger API makes it impossible
to reconstruct the matchup, the API is broken.

Even if there is a primary key, the API should not force you to rely
on that; what of an UPDATE that changes the primary key?

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Richard Huxton 2004-01-20 19:05:46 Re: Trigger question
Previous Message Stephan Szabo 2004-01-20 16:30:29 Re: Trigger question