List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:June 4 1999 2:07pm
Subject:Re: update & timestamp - bug or feature?
View as plain text  
At 12:38 AM -0500 6/4/99, Davor Cengija wrote:
>On Thu, 3 Jun 1999, Paul DuBois wrote:
>
>>At 3:00 PM -0500 6/3/99, Davor Cengija wrote:
>
>>>update my_table set some_value = 'other word' where id = .whatever.;
>>>
>>>       causes the some_value to change, of course, AND ts (timestamp
>>>       column) is updated as well, so it has the time when the row
>>>       was updated, not inserted (what i'd expect).
>>>
>>>       so, is it a bug od feature?
>>
>>Well, what you're observing is how it's documented to work, so I guess
>>I'd say "feature".
>>
>>
>>>       to avoid this problem, i'm using
>>>
>>>update my_table set some_value = 'other word', ts = ts where id =
>>>.whatever.;
>>>
>>>       as mentioned in the manual under Update.
>>
>>
>>Now you know why it says that in the manual. :-)
>
>       hehehe... put it in the manual and it becomes a feature:-)

That's preferable to not documenting it, isn't it?

>       however, i wrote the previous mail considering that 'feature'
>       a little bit 'wrong', and therefore considering it 'buggy'...

Why do you consider it so?  Just curious.

You can get the behavior you want with a DATETIME column instead, that you
set to NOW() when you create a record and leave alone thereafter.  I'm not
sure I see the problem.

--
Paul DuBois, paul@stripped
Northern League Chronicles: http://www.snake.net/nl/
Thread
update & timestamp - bug or feature?Davor Cengija4 Jun
  • Re: update & timestamp - bug or feature?Paul DuBois4 Jun
    • Re: update & timestamp - bug or feature?Davor Cengija4 Jun
      • Re: update & timestamp - bug or feature?Michael Widenius4 Jun
      • Re: update & timestamp - bug or feature?Paul DuBois4 Jun