srdjan wrote:
> /*
> *My goal is to calculate and insert automatically the value of "tot"
> when I insert a row into table b.*
> */
Use a trigger. It's a lot simpler.
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support