In PostgreSQL, the array_upper()
function returns the upper bound of the specified array dimension. We pass the array as well as the dimension, and it returns the upper bound accordingly.
Tag: what is
A Quick Intro to the ARRAY_LOWER() Function in PostgreSQL
In PostgreSQL, the array_lower()
function returns the lower bound of the specified array dimension. We pass the array and the relevant dimension, and it returns the lower bound for that dimension.
A Quick Overview of ARRAY_NDIMS() in PostgreSQL
In PostgreSQL the array_ndims()
function returns the number of dimensions of an array. We pass the array to the function, and it returns an integer of the number of dimensions in the array.
This function is not to be confused with the array_dims()
function, which returns a more detailed text representation of the dimensions in the array.
Understanding ARRAY_DIMS() in PostgreSQL
In PostgreSQL we can use the array_dims()
function to return information about the dimensions in an array. The function accepts the array in question, and it returns a text representation of the array’s dimensions.
This function is not to be confused with the array_ndims()
function, which simply returns the number of dimensions in an array.
PostgreSQL RANDOM_NORMAL() Function Explained
In PostgreSQL we can use the random_normal()
function to generate a normally-distributed random number.
A normally-distributed random number is a random variable with a Gaussian distribution. This is said to be normally distributed, and is referred to as a normal deviate.
Continue readingUnderstanding Arrays in PostgreSQL
In PostgreSQL we have the ability to create variable-length multidimensional arrays and define columns as array types.
Here’s a quick overview of PostgreSQL arrays.
Continue readingA Quick Overview of ARRAY_AGG() in PostgreSQL
PostgreSQL has an aggregate function called array_agg()
that allows us to generate an array from the result set of a query.
The function accepts an argument which is used to generate the array. This argument is typically the column that we want to use in order to populate the array.
Continue readingUnderstanding the ARRAY Constructor in PostgreSQL
In PostgreSQL we can create arrays with the ARRAY
constructor. An array constructor is an expression that builds an array value using values for its member elements.
An Overview of the GENERATE_SUBSCRIPTS() Function in PostgreSQL
PostgreSQL has a generate_subscripts()
function that generates a series comprising the valid subscripts of a given array.
We pass the array to the function, along with the dimension that we want to use. We also have the option of returning the series in reverse order.
Continue readingA Quick Overview of the ARRAY_SHUFFLE() Function in PostgreSQL
In PostgreSQL array_shuffle()
is a system function that randomly shuffles the first dimension of a given array.
The array_shuffle()
function was introduced in PostgreSQL 16, which was released on September 14th 2023.