I wrote a plpgsql function/stored procedure to get around this problem.
I am not sure specifically what information you need about the row
after INSERT, but you could write a function that performs the INSERTs
and summing. After the initial INSERT you can use a SELECT INTO
statement to pass
We know we need to change INSERT rules to fire after the command.
Hopefully this will be done in 7.2.
> I read at the docs that rules are executed before the query that
> generated them. Is there any way to change this?
>
> Here's my problem: I have two tables, A and B, and after an INSERT on
>
Here are some good references on using triggers:
http://www.postgresql.org/docs/aw_pgsql_book/node204.html
http://www.postgresql.org/users-lounge/docs/7.0/user/c40874113.htm
These docs show you how to create a trigger, and use the information
contained in the new tuple for calculations
Mich
Yes, but how can I pass a reference of the row just inserted to the
trigger??
adb wrote:
>
> Sounds like you need to use a trigger set to
> fire after the insert on table A
>
> Alex.
>
> On Tue, 30 Jan 2001, Nelio Alves Pereira Filho wrote:
>
> > I read at the docs that rules are executed bef
Sounds like you need to use a trigger set to
fire after the insert on table A
Alex.
On Tue, 30 Jan 2001, Nelio Alves Pereira Filho wrote:
> I read at the docs that rules are executed before the query that
> generated them. Is there any way to change this?
>
> Here's my problem: I have two tabl
I read at the docs that rules are executed before the query that
generated them. Is there any way to change this?
Here's my problem: I have two tables, A and B, and after an INSERT on
table A, I want to update an specific field on table B, with the result
of a sum in A. To do this I needed some i