On Mar 12, 2009, at 5:50 PM, James B. Byrne wrote:

...
   and c.date_effective_from >= <transaction_date>
   and c.date_superseded_after <= <transaction_date>

Have I understood things aright?

The one problem I foresee is that changes to the commodity_tax_rates table may not reflect in transaction dates that have passed. What happens if a tax is retroactively ended or applied outside these barriers? Is this tax calculation frozen at the date of the "best information we have"? If so, you might consider an insert-only table and linking the tax decision to the row that happened to be in effect at any time. This would likely require adding a column indicating when the row was inserted.

Cheers,
M

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to