* Joshua D. Drake (j...@commandprompt.com) wrote: > Well I was more referring to the default is: > > check if null, if true return ok > check if valuntil < today, if true return error > else return ok > > To me we don't need the null check. However, when I tested it, > without the null check you can't login. So now I am curious about > what is going on.
Erm, but what is valuntil set to when it's null? I'd expect it to be zero because it hasn't been changed since: TimestampTz vuntil = 0; Using your pseudo-code, you end up with: check if 0 < today, if true return error else return ok Which is why you end up always getting an error when you get rid of the explicit isnull check. Looking at it too quickly, I had assumed that the test was inverted and that your patch worked most of the time but didn't account for GetCurrentTimestamp() going negative. Regardless, setting vuntil to some magic value that really means "it's actually NULL", which is what you'd need to do in order to get rid of that explicit check for null, doesn't strike me as a good idea. When a value is null, we shouldn't be looking at the data at all. Thanks, Stephen
signature.asc
Description: Digital signature