From d92fc37274f991d69d75519e404afd5aa8404add Mon Sep 17 00:00:00 2001 From: IrisWan <150207222+WanYixian@users.noreply.github.com> Date: Mon, 9 Dec 2024 19:31:47 +0800 Subject: [PATCH] Clarify one-based numbering for arrays (#119) * Update array-type.mdx * minor update --- sql/data-types/array-type.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/data-types/array-type.mdx b/sql/data-types/array-type.mdx index cff8789b..531baf8a 100644 --- a/sql/data-types/array-type.mdx +++ b/sql/data-types/array-type.mdx @@ -1,6 +1,6 @@ --- title: "ARRAY type" -description: "An array `T[]` is an ordered list of zero or more elements that share the same data type." +description: "An array `T[]` is an ordered list of zero or more elements that share the same data type. PostgreSQL uses one-based indexing for arrays, meaning an array with n elements starts at `array[1]` and ends at `array[n]`. RisingWave also applies one-based indexing to align with PostgreSQL." --- ## Define an array @@ -46,7 +46,7 @@ CREATE TABLE taxi ( To add values to an array, in the SQL statement, use ARRAY to indicate that this is an array, and then enclose the data in the array with `[]`. For example, `ARRAY ['ABCD1234', 'ABCD1235', 'ABCD1236', 'ABCD1237']`. -#### Examples[](#examples-1 "Direct link to Examples") +### Examples[](#examples-1 "Direct link to Examples") Add values to table `x`: