I have a table that contained 1600 columns and would like to add more fields in that but as per the database rule the more fields not allowed to be created because the higher limit reached.
So I decided to drop few unwanted fields from the table and I did it. Again I tried to add few fields in that table but it's raise the same error that 1600 columns are there you can't add more.
I gone through other tables of postgresql "pg_attribute" and all those fields are there and having delete parameter = True.
What I have tried so far
Drop Constraints Take table data into another table Truncate Table Re-Create Constraints Re-Copy data to the main table.
But still the dropped columns are there in pg_attributes table.
I also tried to remove that records from pg_attribute but then it gives me error like that.
ERROR: catalog is missing 1 attribute(s) for relid 208996 ********** Error ********** ERROR: catalog is missing 1 attribute(s) for relid 208996 SQL state: XX000
Why we have these many columns reason is
We have odoo-magento (postgresql db in used by odoo) integration and in magento there are more than 60000 products and having 3000 unique attributes, so in connector all these attributes are created as fields in product table and I already synced magento -> odoo products and 1600 limit reached. Now it won't me allow to drop fields from that table.
I have fixed that issue in magento-odoo connector and it will only sync required attributes but what should I do for already synced fields how can I remove it ????
Even dropping a table is not a proper way because it's huge and very important table so I can take any risk with that.
What I want to do
I want to simply remove those columns from the table and will need to be added few other columns instead.
Is there any other possible solution for this issue ?
Any help would be really appreciated.