[NOVICE] where and how to store calculated data?

Поиск
Список
Период
Сортировка
От Rounak Jain
Тема [NOVICE] where and how to store calculated data?
Дата
Msg-id CANNuxWNUuK+UGWsjAK8ZenuXYfbGSdub87QiW98SfBM3842Wcg@mail.gmail.com
обсуждение исходный текст
Ответы Re: [NOVICE] where and how to store calculated data?
Список pgsql-novice
I am creating a python CLI app with psql for invoicing.

For sale_invoice_detail table, I have created columns, rate_after_discount and amount_after_discount. I do the appropriate calculations in my python code to set/update values in these columns when rate, qty, discount etc are set/modified.

Now, I shall need the sum of the sub-totals (amount_after_discount of the above table). Should I save this amount in the sale_invoice table and ensure that the value gets updated when there is any related change in the sale_invoice_detail table or is there a better way?

В списке pgsql-novice по дате отправления:

Предыдущее
От: balasubramaniam
Дата:
Сообщение: [NOVICE] Bulk load billions of records into Postgres cluster
Следующее
От: Ed Behn
Дата:
Сообщение: Re: [NOVICE] where and how to store calculated data?