postgresql - table can have at most 1600 columns in postgres openerp -


in open-erp application getting error below:

     2015-04-01 09:35:55,959 4169 error new_db openerp.sql_db: bad query: alter table "product_product" add column "location" varchar traceback (most recent call last):   file "/opt/openerp/server/openerp/sql_db.py", line 226, in execute     res = self._obj.execute(query, params) operationalerror: tables can have @ 1600 columns  2015-04-01 09:35:55,960 4169 error new_db openerp: failed initialize database `new_db`. traceback (most recent call last):   file "/opt/openerp/server/openerp/cli/server.py", line 97, in preload_registry     db, registry = openerp.pooler.get_db_and_pool(dbname,update_module=update_module)   file "/opt/openerp/server/openerp/pooler.py", line 33, in get_db_and_pool     registry = registrymanager.get(db_name, force_demo, status, update_module)   file "/opt/openerp/server/openerp/modules/registry.py", line 203, in     update_module)   file "/opt/openerp/server/openerp/modules/registry.py", line 233, in new     openerp.modules.load_modules(registry.db, force_demo, status, update_module)   file "/opt/openerp/server/openerp/modules/loading.py", line 350, in load_modules     force, status, report, loaded_modules, update_module)   file "/opt/openerp/server/openerp/modules/loading.py", line 256, in load_marked_modules     loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)   file "/opt/openerp/server/openerp/modules/loading.py", line 165, in load_module_graph     init_module_models(cr, package.name, models)   file "/opt/openerp/server/openerp/modules/module.py", line 374, in init_module_models     result = obj._auto_init(cr, {'module': module_name})   file "/opt/openerp/server/openerp/osv/orm.py", line 3164, in _auto_init     cr.execute('alter table "%s" add column "%s" %s' % (self._table, k, get_pg_type(f)[1]))   file "/opt/openerp/server/openerp/sql_db.py", line 161, in wrapper     return f(self, *args, **kwargs)   file "/opt/openerp/server/openerp/sql_db.py", line 226, in execute     res = self._obj.execute(query, params) operationalerror: tables can have @ 1600 columns 

i remove unnecessary columns product_product table, above error still comes.

how resolve it, kindly suggest me. waiting reply. thanks

i know may little late (and maybe you've found answer in travels) of writing (aug 2016) dropping column postgres database table not remove column table space, merely hides , column still counts toward table space's column limit, see postgres' documentation on alter table operation.

"the drop column form not physically remove column, makes invisible sql operations. subsequent insert , update operations in table store null value column. thus, dropping column quick not reduce on-disk size of table, space occupied dropped column not reclaimed. space reclaimed on time existing rows updated. (these statements not apply when dropping system oid column; done immediate rewrite.)"

source: https://www.postgresql.org/docs/9.5/static/sql-altertable.html

so if have migrations or operation performs drop/add cycle repeatedly on table, begin exhaust available columns until reach limit.

dropping table , recreating it, or copying data new table using insert into (though you'll have recreate foreign keys, etc.), result in clean table without of (hidden) dropped columns previous operations. reset column number count.


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -