[MDEV-6121] Add support for arrays in tables Created: 2014-04-16  Updated: 2024-01-13

Status: Open
Project: MariaDB Server
Component/s: None
Fix Version/s: None

Type: Task Priority: Major
Reporter: Sergei Golubchik Assignee: Alexander Barkov
Resolution: Unresolved Votes: 14
Labels: Compatibility

Issue Links:
Blocks
blocks MDEV-10143 User defined types Open
is blocked by MDEV-32380 Array data type for stored routnes Stalled
PartOf
is part of MDEV-10137 Providing compatibility to other data... Open
Relates
relates to MDEV-6632 Allowing JSON Arrays(lists) in Dynami... Closed
relates to MDEV-8170 String access operator [] Open
Epic Link: Oracle Compatibility

 Description   

Arrays, like in Postgresql

This MDEV is about adding ARRAY support as table columns.

ARRAY for SP variables will be added first by a separate blocker task MDEV-32380.



 Comments   
Comment by roberto spadim [ 2014-08-07 ]

maybe we could use dynamic columns and add a "natural sql interface"?

Comment by Daniël van Eeden [ 2015-10-17 ]

The PostgreSQL implementation looks like this:

postgres=# CREATE TABLE t1 (id serial, myarray int[]);
CREATE TABLE
postgres=# INSERT INTO t1(myarray) VALUES('{1, 2, 4}');
INSERT 0 1
postgres=# SELECT * FROM t1;
 id | myarray 
----+---------
  1 | {1,2,4}
(1 row)
postgres=# SELECT id, myarray[1], myarray[2], myarray[3] FROM t1;
 id | myarray | myarray | myarray 
----+---------+---------+---------
  1 |       1 |       2 |       4
(1 row)

Docs: http://www.postgresql.org/docs/9.5/static/arrays.html

It looks like array's are a SQL:2008 feature. It is mentioned as feature S091, “Basic array support” in SQL:2011

Generated at Thu Feb 08 07:09:31 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.