Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> SELECT item_id WHERE expire = 0

I come across a lot of SQL databases that uses 0 instead of false.

Is there any good reason for this?



false would be "expired", this is called "expire" because it is a timestamp, it's the epoch time when the item expires. The worker presumably finishes before that time and if it does then the item is deleted. So, if any item has a nonzero expires in the past then it needs to be reset to 0 so it can be retried.


Only in databases that have no Boolean type.

Sometimes it's an artifact of the orm mapping.


So that you don't need a separate column for an associated datum?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: