Skip to content

Commit

Permalink
docs: Update data type alias (#951)
Browse files Browse the repository at this point in the history
Signed-off-by: tison <wander4096@gmail.com>
  • Loading branch information
tisonkun committed May 14, 2024
1 parent 41b4178 commit 1c0bddd
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 36 deletions.
36 changes: 18 additions & 18 deletions docs/nightly/en/reference/sql/data-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,24 +90,24 @@ INSERT INTO bools(b) VALUES (TRUE), (FALSE);

For users migrating from MySQL or PostgreSQL to GreptimeDB, GreptimeDB supports the following alias types.

| Data Type | Alias Types |
|----------------------|-------------------------------------------|
| `String` | `Text`, `Varchar`, `Char` |
| `Binary` | `Varbinary` |
| `Int8` | `TinyInt` |
| `Int16` | `SmallInt` |
| `Int32` | `Int` |
| `Int64` | `BigInt` |
| `UInt8` | `UnsignedInt` |
| `UInt16` | `UnsignedTinyInt` |
| `UInt32` | `UnsignedSmallInt` |
| `UInt64` | `UnsignedBigInt` |
| `Float32` | `Float` |
| `Float64` | `Double` |
| `TimestampSecond` | `Timestamp_s`, `Timestamp_sec`, `Timestamp(0)` |
| `TimestampMillisecond`| `Timestamp`, `Timestamp_ms` , `Timestamp(3)`|
| `TimestampMicroSecond`| `Timestamp_us`, `Timestamp(6)` |
| `TimestampNanosecond`| `Timestamp_ns`, `Timestamp(9)` |
| Data Type | Alias Types |
| ---------------------- | --------------------------------------------------------------- |
| `String` | `Text`, `TinyText`, `MediumText`, `LongText`, `Varchar`, `Char` |
| `Binary` | `Varbinary` |
| `Int8` | `TinyInt` |
| `Int16` | `SmallInt` |
| `Int32` | `Int` |
| `Int64` | `BigInt` |
| `UInt8` | `UnsignedInt` |
| `UInt16` | `UnsignedTinyInt` |
| `UInt32` | `UnsignedSmallInt` |
| `UInt64` | `UnsignedBigInt` |
| `Float32` | `Float` |
| `Float64` | `Double` |
| `TimestampSecond` | `Timestamp_s`, `Timestamp_sec`, `Timestamp(0)` |
| `TimestampMillisecond` | `Timestamp`, `Timestamp_ms`, `Timestamp(3)` |
| `TimestampMicroSecond` | `Timestamp_us`, `Timestamp(6)` |
| `TimestampNanosecond` | `Timestamp_ns`, `Timestamp(9)` |

You can use these alias types when creating tables.
For example, use `Varchar` instead of `String`, `Double` instead of `Float64`, and `Timestamp(0)` instead of `TimestampMillisecond`.
Expand Down
36 changes: 18 additions & 18 deletions docs/nightly/zh/reference/sql/data-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,24 +89,24 @@ INSERT INTO bools(b) VALUES (TRUE), (FALSE);

对于从 MySQL 或 PostgreSQL 迁移到 GreptimeDB 的用户,GreptimeDB 支持以下类型别名。

| 数据类型 | 别名 |
|----------------------|----------------------------------------|
| `String` | `Text`, `Varchar`, `Char` |
| `Binary` | `Varbinary` |
| `Int8` | `TinyInt` |
| `Int16` | `SmallInt` |
| `Int32` | `Int` |
| `Int64` | `BigInt` |
| `UInt8` | `UnsignedInt` |
| `UInt16` | `UnsignedTinyInt` |
| `UInt32` | `UnsignedSmallInt` |
| `UInt64` | `UnsignedBigInt` |
| `Float32` | `Float` |
| `Float64` | `Double` |
| `TimestampSecond` | `Timestamp_s`, `Timestamp_sec`, `Timestamp(0)` |
| `TimestampMillisecond`| `Timestamp`, `Timestamp_ms` , `Timestamp(3)`|
| `TimestampMicroSecond`| `Timestamp_us`, `Timestamp(6)` |
| `TimestampNanosecond`| `Timestamp_ns`, `Timestamp(9)` |
| 数据类型 | 别名 |
| ---------------------- | --------------------------------------------------------------- |
| `String` | `Text`, `TinyText`, `MediumText`, `LongText`, `Varchar`, `Char` |
| `Binary` | `Varbinary` |
| `Int8` | `TinyInt` |
| `Int16` | `SmallInt` |
| `Int32` | `Int` |
| `Int64` | `BigInt` |
| `UInt8` | `UnsignedInt` |
| `UInt16` | `UnsignedTinyInt` |
| `UInt32` | `UnsignedSmallInt` |
| `UInt64` | `UnsignedBigInt` |
| `Float32` | `Float` |
| `Float64` | `Double` |
| `TimestampSecond` | `Timestamp_s`, `Timestamp_sec`, `Timestamp(0)` |
| `TimestampMillisecond` | `Timestamp`, `Timestamp_ms` , `Timestamp(3)` |
| `TimestampMicroSecond` | `Timestamp_us`, `Timestamp(6)` |
| `TimestampNanosecond` | `Timestamp_ns`, `Timestamp(9)` |

在创建表时也可以使用这些别名类型。
例如,使用 `Varchar` 代替 `String`,使用 `Double` 代替 `Float64`,使用 `Timestamp(0)` 代替 `TimestampMillisecond`
Expand Down

0 comments on commit 1c0bddd

Please sign in to comment.