N3Roaster / typica

Free software for coffee roasting operations.
https://typica.us
MIT License
26 stars 8 forks source link

SQL queries should not rely on column ordering #125

Closed N3Roaster closed 9 years ago

N3Roaster commented 10 years ago

I just spent some time trying to figure out a database issue for someone and it turned out that their backup/restore process was causing certain database tables to be restored with columns in the wrong order. While I don't consider this to be a bug in Typica per se, all queries can be written in such a way that the columns used are explicitly named, removing the assumption that columns exist in any particular order. INSERT statements are most likely to make this assumption. All SQL statements in Typica and the provided configuration should be reviewed and modified if needed to remove any assumption of column order.

N3Roaster commented 10 years ago

Confirmed that this is collateral damage from a PostgreSQL bug (9555). I'm not holding my breath on that getting fixed any time soon and appropriate workarounds should be made in Typica regardless as people don't like to upgrade their RDBMs.

N3Roaster commented 9 years ago

I've started auditing the configuration files to correct this issue. Partial fixes are in the development branch as of today and I hope to have this fully fixed in time for the 1.6.3 release.