Again from the MySQL docs.

MySQL Doumentation
------------------------------------------
The TIMESTAMP data type has a range of '1970-01-01 00:00:01' UTC to 
'2038-01-09 03:14:07' UTC. It has varying properties, depending on the 
MySQL version and the SQL mode the server is running in. These 
properties are described later in this section.
------------------------------------------

> Actually, I researched it somewhere, it turns out TIMESTAMP should be 
> completely able to replace DATETIME without caveats.

So this statement is NOT true. DATETIME can store values before Jan 1, 
1970 TIMESTAMP cannot. Therefore, you cannot say that TIMESTAMP is a 
replacement for DATETIME. And then there's the issue of not allowing 
null values, which also apparently makes this statement false.

It was me that said that TIMESTAMP auto-updates. However, that 
information was based on an old version of MySQL. TIMESTAMP in the 
latest versions of MySQL have the option of auto-updating, but can be 
configured not to do that. Sorry I was unaware of this change because I 
stopped using TIMESTAMP data type a long time ago based on the old 
behavior.

Here is the documentation from MySQL prior to 4.1, which my earlier 
statements were based upon:
-------------------------------------
Automatic updating of the first TIMESTAMP column in a table occurs under 
any of the following conditions:

You explicitly set the column to NULL.

The column is not specified explicitly in an INSERT or LOAD DATA INFILE 
statement.

The column is not specified explicitly in an UPDATE statement and some 
other column changes value. An UPDATE that sets a column to the value it 
does not cause the TIMESTAMP column to be updated; if you set a column 
to its current value, MySQL ignores the update for efficiency.
-------------------------------------

So as you can see my statements were in fact based on old information. 
Again, sorry for the confusion.

Aryk Grosz wrote:
> Actually, I researched it somewhere, it turns out TIMESTAMP should be 
> completely able to replace DATETIME without caveats.
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to