Restarting openerp enough number of times causes postgres to throw 'reached max column limit error'
Here's the scenario - Lets say I install a module which changes the column type of a table. And this module changes the type of the date_order field in sale_order table from date to datetime. Now what happens is everytime I restart openerp with updateall modules flag, it drops the original date_order column (with type date) in the table and adds a new column date_order with type datetime.
Now postgres maintains a reference to all of its columns per table in pg_attribute table, which doesnt get cleared even when you drop the columns. Because of this every drop-column-add-column cycle that occurs when you restart openerp increments the column count for the table and in this case its the sale_order table. But the problem is postgres has a column limit of 1600 per table which will be reached if you restart openerp 800 times. And then openerp fails to start.
This is only in case of 1 column. If modules override multiple columns in the table, this limit will be reached sooner.
So the question is, is there a well known way to solve this problem with openerp?
My guess is this is not a very rare case scenario and some people may have already faced this problem. Are there any recommended solutions or conventions or best practices ?