NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
When? now()! (Score:1)
Because I certainly don't believe that all of my middleware has the exact same time, and I want a single canonical reference for the time I added a row to the database.
Maybe I'm too lazy always to include
now()every time I insert a row into the table, and I'm definitely too lazy to write a stored procedure to insert the row or a trigger to set those values, but the fewer magical things the middleware has to do andRe: (Score:1)
If the the designer has said they want an empty timestamp to default to NULL, the value should be NULL, not whatever the database decides to do with it.
What if my first timestamp column in a table represents the date that I shipped an order to a customer and the second represents the date it was ordered? If I haven't shipped it to the customer yet
Re: (Score:1)
True. Likewise, I didn't provide a convincing argument why butterscotch is disgusting, but at least I can defend that position.
Re: (Score:1)
Yes, that is a good argument showing that it makes perfect sense to use
DEFAULT CURRENT_TIMESTAMP.However, am I missing something, or did you fail to even notice that the point in question is about
DEFAULT NULL(which is being treated the same asDEFAULT CURRENT_TIMESTAMPfor some bizarre reason (except when it’s not))?Re: (Score:1)
You're right; I did fail to notice that. Somehow I turned it around in my head so that it meant "When you insert no value into this column," which is completely different.
hysterical raisins (Score:1)
death to timestamps (Score:1)
Sure, it's a sign of programmer failure, but it's yet another case where MySQL makes easy things
rjbs