Development:XMLDB column types: Difference between revisions
From MoodleDocs
(7 intermediate revisions by 3 users not shown) | |||
Line 69: | Line 69: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>char</td> | <td>char | ||
<small>size limit</small> | |||
</td> | |||
<td> | <td> | ||
:'''VARCHAR''' | :'''VARCHAR''' | ||
Line 122: | Line 124: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>datetime</td> | <td>datetime<sup>(*)</sup></td> | ||
<td> | <td> | ||
:'''DATETIME''' | :'''DATETIME''' | ||
Line 137: | Line 139: | ||
</tr> | </tr> | ||
</table> | </table> | ||
(*) Note that, although datetime types are supported by XMLDB, '''all datetime/timestamp columns''' under Moodle are declared as '''integer(10)''' and filled with '''Unix timestamps''', so '''this type of column shouldn't be used at all''' (in fact, the XMLDB Editor doesn't show them as an available option). | |||
== Some official links == | == Some official links == | ||
Line 145: | Line 149: | ||
* Oracle: http://www.cs.umbc.edu/help/oracle8/server.815/a68003/01_04blt.htm | * Oracle: http://www.cs.umbc.edu/help/oracle8/server.815/a68003/01_04blt.htm | ||
[[Category:XMLDB]] | [[Category:XMLDB]] |
Latest revision as of 18:06, 18 December 2007
XMLDB Documentation > XMLDB column types
This page will show, once finished, one compatibility matrix of column types for each of the RDBMS under which Moodle is expected to work.
The matrix
XMLDB Type | MySQL | PostgreSQL | Oracle | MSSQL |
---|---|---|---|---|
int |
|
|
|
|
number |
|
|
|
|
float |
|
|
|
|
char
size limit |
<5.0.3 0-255 chars, >=5.0.3 0-65535 chars |
about 1GB ot text |
4000 bytes |
4000 chars |
text |
|
|
|
|
binary |
|
|
|
|
datetime(*) |
|
|
|
|
(*) Note that, although datetime types are supported by XMLDB, all datetime/timestamp columns under Moodle are declared as integer(10) and filled with Unix timestamps, so this type of column shouldn't be used at all (in fact, the XMLDB Editor doesn't show them as an available option).
Some official links
- MySQL: http://dev.mysql.com/doc/refman/5.0/en/data-types.html
- PostgreSQL: http://www.postgresql.org/docs/7.4/static/datatype.html
- SQL*Server: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_da-db_7msw.asp
- Oracle: http://www.cs.umbc.edu/help/oracle8/server.815/a68003/01_04blt.htm