Posted on 24th April 2024
When the user defines a data type, the corresponding array type created in the background by the PostgreSQL.
We need to remember that each data type has its corresponding array.
Let us consider a few examples:
Append an element to the end of an array
For example:
array_append(ARRAY[Sam,Aroni], Tom)
Result:
{Sam, Aroni, Tom}
concatenate two arrays
For example:
array_cat(ARRAY[1,2,3], ARRAY[4,5])
Result:
{1,2,3,4,5}
returns the number of dimensions of the array
For example:
array_ndims(ARRAY[[1,2,3], [4,5,6]])
Result:
2
returns the length of the requested array dimension
For example:
array_length(array[1,2,3], 1)
Result:
3
STILL GOT QUERIES?