Search Postgresql Archives

Re: starting a stored procedure+rule AFTER an insert

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Bima Djaloeis" <bima.djaloeis.uni@xxxxxxxxxxxxxx> writes:

> 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?

Rules effectively happen at query parse time.  You probably want an
AFTER trigger instead.

-Doug

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux