Skip to content

Commit

Permalink
docs: update timestamp range
Browse files Browse the repository at this point in the history
  • Loading branch information
v0y4g3r committed Nov 14, 2024
1 parent e23e36f commit f355d97
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 38 deletions.
12 changes: 8 additions & 4 deletions docs/reference/sql/data-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,16 @@ Output:

| Type Name | Description | Size |
|-----------|-------------|------|
| `TimestampSecond` | 64-bit timestamp values with seconds precision | 8 Bytes |
| `TimestampMillisecond` | 64-bit timestamp values with milliseconds precision | 8 Bytes |
| `TimestampMicroSecond` | 64-bit timestamp values with microseconds precision | 8 Bytes |
| `TimestampNanosecond` | 64-bit timestamp values with nanoseconds precision | 8 Bytes |
| `TimestampSecond` | 64-bit timestamp values with seconds precision, range: `[-262144-01-01 00:00:00, +262143-12-31 23:59:59]` | 8 Bytes |
| `TimestampMillisecond` | 64-bit timestamp values with milliseconds precision, range: `[-262144-01-01 00:00:00.000, +262143-12-31 23:59:59.999]` | 8 Bytes |
| `TimestampMicroSecond` | 64-bit timestamp values with microseconds precision, range: `[-262144-01-01 00:00:00.000000, +262143-12-31 23:59:59.999999]` | 8 Bytes |
| `TimestampNanosecond` | 64-bit timestamp values with nanoseconds precision, range: `[1677-09-21 00:12:43.145225, 2262-04-11 23:47:16.854775807]` | 8 Bytes |
| `Interval`| Time interval | 4 Bytes for `YearMonth`, 8 Bytes for `DayTime` and 16 Bytes for `MonthDayNano`|

:::tip NOTE
When inserting Timestamp string literals to GreptimeDB using MySQL/PostgreSQL protocol, the value range is limited to '0001-01-01 00:00:00' to '9999-12-31 23:59:59'.
:::

### Interval Type

`Interval` type is used in scenarios where you need to track and manipulate time durations. It can be written using the following verbose syntax:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,15 @@ SELECT * FROM decimals;

| 类型名称 | 描述 | 大小 |
|-----------|-------------|------|
| `TimestampSecond` | 64 位时间戳值,精度为秒 | 8 字节 |
| `TimestampMillisecond` | 64 位时间戳值,毫秒精度 | 8 字节 |
| `TimestampMicroSecond` | 64 位时间戳值,微秒精度 | 8 字节 |
| `TimestampNanosecond` | 64 位时间戳值,纳秒精度 | 8 字节 |
| `Interval`| 时间间隔 | `YearMonth` 占 4 字节,`DayTime` 占 8 字节,`MonthDayNano` 占 16 字节|
| `TimestampSecond` | 64 位时间戳值,精度为秒,范围:`[-262144-01-01 00:00:00, +262143-12-31 23:59:59]` | 8 字节 |
| `TimestampMillisecond` | 64 位时间戳值,毫秒精度,范围:`[-262144-01-01 00:00:00.000, +262143-12-31 23:59:59.999]` | 8 字节 |
| `TimestampMicroSecond` | 64 位时间戳值,微秒精度,范围:`[-262144-01-01 00:00:00.000000, +262143-12-31 23:59:59.999999]` | 8 字节 |
| `TimestampNanosecond` | 64 位时间戳值,纳秒精度,范围: `[1677-09-21 00:12:43.145225, 2262-04-11 23:47:16.854775807]` | 8 字节 |
| `Interval`| 时间间隔 | 对于 `YearMonth`, 使用4字节,对于 `DayTime`, 使用8字节,对于 `MonthDayNano`, 使用16字节 |

:::tip 注意
使用 MySQL/PostgreSQL 协议写入时间戳字符串字面量时,值的范围限制为 '0001-01-01 00:00:00' 到 '9999-12-31 23:59:59'。
:::

### Interval 类型详解

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,15 @@ SELECT * FROM decimals;

| 类型名称 | 描述 | 大小 |
|-----------|-------------|------|
| `TimestampSecond` | 64 位时间戳值,精度为秒 | 8 字节 |
| `TimestampMillisecond` | 64 位时间戳值,毫秒精度 | 8 字节 |
| `TimestampMicroSecond` | 64 位时间戳值,微秒精度 | 8 字节 |
| `TimestampNanosecond` | 64 位时间戳值,纳秒精度 | 8 字节 |
| `TimestampSecond` | 64 位时间戳值,精度为秒,范围:`[-262144-01-01 00:00:00, +262143-12-31 23:59:59]` | 8 字节 |
| `TimestampMillisecond` | 64 位时间戳值,毫秒精度,范围:`[-262144-01-01 00:00:00.000, +262143-12-31 23:59:59.999]` | 8 字节 |
| `TimestampMicroSecond` | 64 位时间戳值,微秒精度,范围:`[-262144-01-01 00:00:00.000000, +262143-12-31 23:59:59.999999]` | 8 字节 |
| `TimestampNanosecond` | 64 位时间戳值,纳秒精度,范围: `[1677-09-21 00:12:43.145225, 2262-04-11 23:47:16.854775807]` | 8 字节 |
| `Interval`| 时间间隔 | 对于 `YearMonth`, 使用4字节,对于 `DayTime`, 使用8字节,对于 `MonthDayNano`, 使用16字节 |

:::tip 注意
使用 MySQL/PostgreSQL 协议写入时间戳字符串字面量时,值的范围限制为 '0001-01-01 00:00:00' 到 '9999-12-31 23:59:59'。
:::

## 布尔类型

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,15 @@ SELECT * FROM decimals;

| 类型名称 | 描述 | 大小 |
|-----------|-------------|------|
| `TimestampSecond` | 64 位时间戳值,精度为秒 | 8 字节 |
| `TimestampMillisecond` | 64 位时间戳值,毫秒精度 | 8 字节 |
| `TimestampMicroSecond` | 64 位时间戳值,微秒精度 | 8 字节 |
| `TimestampNanosecond` | 64 位时间戳值,纳秒精度 | 8 字节 |
| `TimestampSecond` | 64 位时间戳值,精度为秒,范围:`[-262144-01-01 00:00:00, +262143-12-31 23:59:59]` | 8 字节 |
| `TimestampMillisecond` | 64 位时间戳值,毫秒精度,范围:`[-262144-01-01 00:00:00.000, +262143-12-31 23:59:59.999]` | 8 字节 |
| `TimestampMicroSecond` | 64 位时间戳值,微秒精度,范围:`[-262144-01-01 00:00:00.000000, +262143-12-31 23:59:59.999999]` | 8 字节 |
| `TimestampNanosecond` | 64 位时间戳值,纳秒精度,范围: `[1677-09-21 00:12:43.145225, 2262-04-11 23:47:16.854775807]` | 8 字节 |
| `Interval`| 时间间隔 | 对于 `YearMonth`, 使用4字节,对于 `DayTime`, 使用8字节,对于 `MonthDayNano`, 使用16字节 |

:::tip 注意
使用 MySQL/PostgreSQL 协议写入时间戳字符串字面量时,值的范围限制为 '0001-01-01 00:00:00' 到 '9999-12-31 23:59:59'。
:::

## 布尔类型

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,15 @@ SELECT * FROM decimals;

| 类型名称 | 描述 | 大小 |
|-----------|-------------|------|
| `TimestampSecond` | 64 位时间戳值,精度为秒 | 8 字节 |
| `TimestampMillisecond` | 64 位时间戳值,毫秒精度 | 8 字节 |
| `TimestampMicroSecond` | 64 位时间戳值,微秒精度 | 8 字节 |
| `TimestampNanosecond` | 64 位时间戳值,纳秒精度 | 8 字节 |
| `Interval`| 时间间隔 | `YearMonth` 占 4 字节,`DayTime` 占 8 字节,`MonthDayNano` 占 16 字节|
| `TimestampSecond` | 64 位时间戳值,精度为秒,范围:`[-262144-01-01 00:00:00, +262143-12-31 23:59:59]` | 8 字节 |
| `TimestampMillisecond` | 64 位时间戳值,毫秒精度,范围:`[-262144-01-01 00:00:00.000, +262143-12-31 23:59:59.999]` | 8 字节 |
| `TimestampMicroSecond` | 64 位时间戳值,微秒精度,范围:`[-262144-01-01 00:00:00.000000, +262143-12-31 23:59:59.999999]` | 8 字节 |
| `TimestampNanosecond` | 64 位时间戳值,纳秒精度,范围: `[1677-09-21 00:12:43.145225, 2262-04-11 23:47:16.854775807]` | 8 字节 |
| `Interval`| 时间间隔 | 对于 `YearMonth`, 使用4字节,对于 `DayTime`, 使用8字节,对于 `MonthDayNano`, 使用16字节 |

:::tip 注意
使用 MySQL/PostgreSQL 协议写入时间戳字符串字面量时,值的范围限制为 '0001-01-01 00:00:00' 到 '9999-12-31 23:59:59'。
:::

### Interval 类型详解

Expand Down
13 changes: 9 additions & 4 deletions versioned_docs/version-0.6/reference/sql/data-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,15 @@ Output:

| Type Name | Description | Size |
|-----------|-------------|------|
| `TimestampSecond` | 64-bit timestamp values with seconds precision | 8 Bytes |
| `TimestampMillisecond` | 64-bit timestamp values with milliseconds precision | 8 Bytes |
| `TimestampMicroSecond` | 64-bit timestamp values with microseconds precision | 8 Bytes |
| `TimestampNanosecond` | 64-bit timestamp values with nanoseconds precision | 8 Bytes |
| `TimestampSecond` | 64-bit timestamp values with seconds precision, range: `[-262144-01-01 00:00:00, +262143-12-31 23:59:59]` | 8 Bytes |
| `TimestampMillisecond` | 64-bit timestamp values with milliseconds precision, range: `[-262144-01-01 00:00:00.000, +262143-12-31 23:59:59.999]` | 8 Bytes |
| `TimestampMicroSecond` | 64-bit timestamp values with microseconds precision, range: `[-262144-01-01 00:00:00.000000, +262143-12-31 23:59:59.999999]` | 8 Bytes |
| `TimestampNanosecond` | 64-bit timestamp values with nanoseconds precision, range: `[1677-09-21 00:12:43.145225, 2262-04-11 23:47:16.854775807]` | 8 Bytes |
| `Interval`| Time interval | 4 Bytes for `YearMonth`, 8 Bytes for `DayTime` and 16 Bytes for `MonthDayNano`|

:::tip NOTE
When inserting Timestamp string literals to GreptimeDB using MySQL/PostgreSQL protocol, the value range is limited to '0001-01-01 00:00:00' to '9999-12-31 23:59:59'.
:::

## Boolean Type

Expand Down
9 changes: 5 additions & 4 deletions versioned_docs/version-0.7/reference/sql/data-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,11 @@ Output:

| Type Name | Description | Size |
|-----------|-------------|------|
| `TimestampSecond` | 64-bit timestamp values with seconds precision | 8 Bytes |
| `TimestampMillisecond` | 64-bit timestamp values with milliseconds precision | 8 Bytes |
| `TimestampMicroSecond` | 64-bit timestamp values with microseconds precision | 8 Bytes |
| `TimestampNanosecond` | 64-bit timestamp values with nanoseconds precision | 8 Bytes |
| `TimestampSecond` | 64-bit timestamp values with seconds precision, range: `[-262144-01-01 00:00:00, +262143-12-31 23:59:59]` | 8 Bytes |
| `TimestampMillisecond` | 64-bit timestamp values with milliseconds precision, range: `[-262144-01-01 00:00:00.000, +262143-12-31 23:59:59.999]` | 8 Bytes |
| `TimestampMicroSecond` | 64-bit timestamp values with microseconds precision, range: `[-262144-01-01 00:00:00.000000, +262143-12-31 23:59:59.999999]` | 8 Bytes |
| `TimestampNanosecond` | 64-bit timestamp values with nanoseconds precision, range: `[1677-09-21 00:12:43.145225, 2262-04-11 23:47:16.854775807]` | 8 Bytes |
| `Interval`| Time interval | 4 Bytes for `YearMonth`, 8 Bytes for `DayTime` and 16 Bytes for `MonthDayNano`|

## Boolean Type

Expand Down
13 changes: 9 additions & 4 deletions versioned_docs/version-0.8/reference/sql/data-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,15 @@ Output:

| Type Name | Description | Size |
|-----------|-------------|------|
| `TimestampSecond` | 64-bit timestamp values with seconds precision | 8 Bytes |
| `TimestampMillisecond` | 64-bit timestamp values with milliseconds precision | 8 Bytes |
| `TimestampMicroSecond` | 64-bit timestamp values with microseconds precision | 8 Bytes |
| `TimestampNanosecond` | 64-bit timestamp values with nanoseconds precision | 8 Bytes |
| `TimestampSecond` | 64-bit timestamp values with seconds precision, range: `[-262144-01-01 00:00:00, +262143-12-31 23:59:59]` | 8 Bytes |
| `TimestampMillisecond` | 64-bit timestamp values with milliseconds precision, range: `[-262144-01-01 00:00:00.000, +262143-12-31 23:59:59.999]` | 8 Bytes |
| `TimestampMicroSecond` | 64-bit timestamp values with microseconds precision, range: `[-262144-01-01 00:00:00.000000, +262143-12-31 23:59:59.999999]` | 8 Bytes |
| `TimestampNanosecond` | 64-bit timestamp values with nanoseconds precision, range: `[1677-09-21 00:12:43.145225, 2262-04-11 23:47:16.854775807]` | 8 Bytes |
| `Interval`| Time interval | 4 Bytes for `YearMonth`, 8 Bytes for `DayTime` and 16 Bytes for `MonthDayNano`|

:::tip NOTE
When inserting Timestamp string literals to GreptimeDB using MySQL/PostgreSQL protocol, the value range is limited to '0001-01-01 00:00:00' to '9999-12-31 23:59:59'.
:::

## Boolean Type

Expand Down
12 changes: 8 additions & 4 deletions versioned_docs/version-0.9/reference/sql/data-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,16 @@ Output:

| Type Name | Description | Size |
|-----------|-------------|------|
| `TimestampSecond` | 64-bit timestamp values with seconds precision | 8 Bytes |
| `TimestampMillisecond` | 64-bit timestamp values with milliseconds precision | 8 Bytes |
| `TimestampMicroSecond` | 64-bit timestamp values with microseconds precision | 8 Bytes |
| `TimestampNanosecond` | 64-bit timestamp values with nanoseconds precision | 8 Bytes |
| `TimestampSecond` | 64-bit timestamp values with seconds precision, range: `[-262144-01-01 00:00:00, +262143-12-31 23:59:59]` | 8 Bytes |
| `TimestampMillisecond` | 64-bit timestamp values with milliseconds precision, range: `[-262144-01-01 00:00:00.000, +262143-12-31 23:59:59.999]` | 8 Bytes |
| `TimestampMicroSecond` | 64-bit timestamp values with microseconds precision, range: `[-262144-01-01 00:00:00.000000, +262143-12-31 23:59:59.999999]` | 8 Bytes |
| `TimestampNanosecond` | 64-bit timestamp values with nanoseconds precision, range: `[1677-09-21 00:12:43.145225, 2262-04-11 23:47:16.854775807]` | 8 Bytes |
| `Interval`| Time interval | 4 Bytes for `YearMonth`, 8 Bytes for `DayTime` and 16 Bytes for `MonthDayNano`|

:::tip NOTE
When inserting Timestamp string literals to GreptimeDB using MySQL/PostgreSQL protocol, the value range is limited to '0001-01-01 00:00:00' to '9999-12-31 23:59:59'.
:::

### Interval Type

`Interval` type is used in scenarios where you need to track and manipulate time durations. It can be written using the following verbose syntax:
Expand Down

0 comments on commit f355d97

Please sign in to comment.