cockroachdb / cockroachdb/cockroach
Multi-dimensional array expressions work but produce wrong results
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
**Describe the problem**
There is claim that multi-dimensional arrays do not work yet:
- https://github.com/cockroachdb/cockroach/issues/32552
- https://www.cockroachlabs.com/docs/stable/functions-and-operators (several mentions of multi-dimensional arrays not being supported)
but they do when using some expressions, however, producing wrong results.
**To Reproduce**
Run:
```sql
select array[array['a']]::text
```
This produces
```
|array |
|-------|
|{"{a}"}|
```
**Expected behavior**
This should produce the following result, as in PostgreSQL:
```
|array|
|-----|
|{{a}}|
```
Or better (since multi-dimensional arrays aren't supported) raise an error.
**Environment:**
- CockroachDB version: CockroachDB CCL v25.1.6 (x86_64-pc-linux-gnu, built 2025/05/09 15:48:03, go1.22.8 X:nocoverageredesign)
- Client app: JDBC
Jira issue: CRDB-50673
Contributor guide
Assessment
This issue has not been assessed yet.