Search Postgresql Archives

SELECT Rules or stored procedure

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

 



I have a query that takes two tables (join) and does something on it.
Lets say these tables are A and B.
What I need is that everytime one of the tables (A) has its rows
selected, I want to update the count (which is a column in A) for that
row.

I am not sure what is the best way to do this.
1)I could create a dummy view and do a RULE on that (I am not sure how
to get access to the row's that have been selected).
 2) I could create a storedprocedure. Get all the rows to be returned
and then, loop through the rows and update the column and then return
it.

Q1) Which way is better?
q2) How does one get access to the rows just selected in the CREATE
RULE computation?

thanks.
-assad


[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