Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update timestamp range #1286

Merged
merged 2 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -57,12 +57,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
Loading