3 ms·
Maximum number of columns is 16 384 (in modern Excel). PostreSQL has a limit of 16 000. So Excel > PostrGRE? :) I wonder what kind of data did you use and why
by rvba 5y ago
Maximum number of columns is 16 384 (in modern Excel). PostreSQL has a limit of 16 000.
So Excel > PostrGRE? :)
I wonder what kind of data did you use and why it had to be stored in so many columns. This approach would probably kill a "real" database too.
- markus_zhang 5y agoOops I definitely got it wrong. Probably a bit more than a thousand columns now that I think about it. Still a beast. The thing is a database with every column a product id.
- mkl 5y agoI was thinking maybe that meant an older version had a limit of 1024, but according to https://www.askingbox.com/info/xls-and-xlsx-maximum-number-of-columns-and-rows https://www.askingbox.com/info/xls-and-xlsx-maximum-number-o... it has always been 256 for .xls and 16384 for .xlsx.
- Someone 5y agoPostreSQL has way more data types than Excel. You can have arrays, json, xml, ranges, polygons, etc. in columns (https://www.postgresql.org/docs/current/datatype.html https://www.postgresql.org/docs/current/datatype.html) Because of that, chances are the natural format for a data item taking 16,384 columns in excel likely takes fewer than 16,000 columns in PostreSQL.
- rrrrrrrrrrrryan 5y agoThe reason why you often encounter spreadsheets with so many columns is because spreadsheets really, really want data to be flat. Analysts often like to have all the possible datasets pre-joined into one monstrous sheet, then they can easily slice and dice it up however they want. With a relational database this would be kind of insane, as it's much easier to normalize data into separate tables, then just join up them up when you need to.