News for hackers. Stuff that matters.
Re:Do you really need Redis? How to get away with just Postg... by wodenokoto on Saturday June 12, 2021 @06:19AM (#27483330)
> 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?

Re:Do you really need Redis? How to get away with just Postg... by chx on Saturday June 12, 2021 @06:33AM (#27483408)
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.
Re:Do you really need Redis? How to get away with just Postg... by xupybd on Saturday June 12, 2021 @06:28AM (#27483381)
Only in databases that have no Boolean type.

Sometimes it's an artifact of the orm mapping.

Re:Do you really need Redis? How to get away with just Postg... by masklinn on Saturday June 12, 2021 @06:30AM (#27483393)
So that you don't need a separate column for an associated datum?