starting a stored procedure+rule AFTER an insert

From: "Bima Djaloeis" <bima(dot)djaloeis(dot)uni(at)googlemail(dot)com>
To: pgsql-novice(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: starting a stored procedure+rule AFTER an insert
Date: 2007-10-05 09:31:04
Message-ID: 77f6bcdd0710050231h108603abgd0f312a7ec02f9ec@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi, Newbie here,

I have implemented a stored procedure that writes out the newest DB entry on
insert, and combined it with a rule.

1) create function newcache() returns void AS 'newCache', 'newCache'
language c;
2) create rule newcacherule AS on insert to caches do also select
newcache();

The problem is that newcacherule fires BEFORE the insert has taken place, so
effectively, I always just get the 2nd newest entry to write into my text
file while the newest entry is "stuck in the queue" until a new insert come.
How can I execute my rule AFTER the insert has taken place?

Thanks for reading!

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Christian Rengstl 2007-10-05 09:41:34 Privileges on information_schema
Previous Message Miroslav Šulc 2007-10-05 09:22:02 Re: ERROR: variable not found in subplan target lists