This is a problem in any database binding that retrieves stuff as an array of values rather than as key-value pairs. This is the default behavior for many, many things, although it’s generally a sign of micro-optimization when it’s being used. (There are definitely systems where it makes a real performance difference though!)
For the reason of stories like these, I feel that doing positional row access is a mistake and you should always use key-value retrieval instead. Even if everything goes right in a migration you don’t really want to be relying on the order of columns in a table. (Which is another reason to avoid SELECT * as well.)
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.