Re: Triggers and locking - Mailing list pgsql-general

From William Temperley
Subject Re: Triggers and locking
Date
Msg-id AANLkTim-x7z_m7Z1g93j=zKB4F6JtNEo8Zhc_M_dgTQ=@mail.gmail.com
Whole thread Raw
In response to Re: Triggers and locking  (Alban Hertroys <dalroi@solfertje.student.utwente.nl>)
List pgsql-general
On 21 September 2010 18:39, Alban Hertroys
<dalroi@solfertje.student.utwente.nl> wrote:
> On 21 Sep 2010, at 16:13, William Temperley wrote:
>
>> Dear all,
>>
>> I have a single "source" table that is referenced by six
>> specialization tables, which include:
>> "journal_article"
>> "report"
>> 4 more....
>>
>> e.g.:
>> """
>> update source set citation = get_report_citation(
>>    (select source from source where id = NEW.source_ptr_id),
>>    NEW
>> );
>> """
>
> Well, depending on how many rows are in source, updating them all can take a while.
> Eventually those changes will have to go to disk, so it's probably pretty much I/O-bound.
>
> I get the impression you're missing a WHERE clause on that UPDATE statement though, or otherwise I can't understand
whyyou'd want to update all citations every time one source record changes. 
>
>
> Alban Hertroys
>

Indeed you're right, I was just missing a WHERE clause. Failed at the
last hurdle there.

All works as intended now, thankyou.

Will Temperley

pgsql-general by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: Memory Errors
Next
From: Peter Hopfgartner
Date:
Subject: Re: Getting FATAL: terminating connection due to administrator command