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

Clarify one-based numbering for arrays #119

Merged
merged 3 commits into from
Dec 9, 2024
Merged
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
4 changes: 2 additions & 2 deletions sql/data-types/array-type.mdx
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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`:

Expand Down
Loading