I have daily stock prices in a table and I've added a column which I'd like to auto calculate. I don't want it to be a manual calculation because the stock prices are something I import into the model with a finance api.

Therefore I just to use `ActiveRecord-import` and then have that column autopopulate.

The columns in question are Percent Change and Average past 5 days. I feel like this is something that I could set up perhaps on the DB side so that those columns auto populate. Almost like Excel is able to just write `=a1/b1` and then the entire table populates. 

Is this possible in either a rails model or postgresql? (using rails 3.2 and postgresql 9.2)