I need to calculate a value for each row in my database. The calculation is quite involved, requiring lookup tables and parameters that are stored in the database too.
Now I know I can write an app, connect to the server, and calculate the value for each row - which is what I am doing now.
But is it also possible to do it the other way round? Namely, have the postgresql server pass the required info to a console app and receive the value to store? In which case you could have PostgreSQL automatically calculate the value each time a new row is inserted.