List:Internals« Previous MessageNext Message »
From:Eric Bergen Date:July 29 2007 8:27pm
Subject:Re: multiple current_timestamp
View as plain text  
It makes sense to only allow one field to have current_timestamp
because having more than one field with current_timestamp would mean
both columns are storing the same data. Is it really that difficult to
have date_updated be current_timestamp and date_added set to null in
the insert query? I don't understand the need for triggers. What
problem are you trying to solve with code or triggers?



On 7/28/07, Arnold Daniels <info@stripped> wrote:
> Hi all,
>
> Why can there be only one timestamp field with current_timestamp in
> default or on update?
>
> I've been wondered about this for a long time. A table often has a field
> `date_added`, with the current timestamp only as default, and a field
> `date_changed` with a changing timestamp upon updating. Basically it is
> irritating me, since now I have to either solve this in code or use a
> trigger. Also because I do not understand why this limitation is necessary.
>
> Is this something that is subjected to change in MySQL 6? I haven't seen
> any plans for it.
>
> Best regards,
> Arnold
>
> --
> MySQL Internals Mailing List
> For list archives: http://lists.mysql.com/internals
> To unsubscribe:    http://lists.mysql.com/internals?unsub=1
>
>


-- 
high performance mysql consulting.
http://provenscaling.com
Thread
multiple current_timestampArnold Daniels29 Jul
  • Re: multiple current_timestampEric Bergen29 Jul
    • Re: multiple current_timestampArnold Daniels30 Jul
      • Re: multiple current_timestampEric Bergen30 Jul
        • Re: multiple current_timestampJim Winstead30 Jul
          • Re: multiple current_timestampTobias Asplund30 Jul
  • Re: multiple current_timestampDmitri Lenev30 Jul
  • mmaping and index file(.MYI) in mysql 5.1.22-rc?ajay singh20 Dec