User Documentation
 All Files Functions Groups
array_ops.sql_in File Reference

implementation of array operations in SQL More...

Go to the source code of this file.

Functions

anyarray array_add (anyarray x, anyarray y)
 Adds two arrays. It requires that all the values are NON-NULL. Return type is the same as the input type. More...
 
anyarray array_sub (anyarray x, anyarray y)
 Subtracts two arrays. It requires that all the values are NON-NULL. Return type is the same as the input type. More...
 
anyarray array_mult (anyarray x, anyarray y)
 Element-wise product of two arrays. It requires that all the values are NON-NULL. Return type is the same as the input type. More...
 
anyarray array_div (anyarray x, anyarray y)
 Element-wise division of two arrays. It requires that all the values are NON-NULL. Return type is the same as the input type. More...
 
float8 array_dot (anyarray x, anyarray y)
 Dot-product of two arrays. It requires that all the values are NON-NULL. Return type is the same as the input type. More...
 
bool array_contains (anyarray x, anyarray y)
 Checks whether one array contains the other. More...
 
anyelement array_max (anyarray x)
 This function finds the maximum value in the array. NULLs are ignored. Return type is the same as the input type. More...
 
anyelement array_min (anyarray x)
 This function finds the minimum value in the array. NULLs are ignored. Return type is the same as the input type. More...
 
anyelement array_sum (anyarray x)
 This function finds the sum of the values in the array. NULLs are ignored. Return type is the same as the input type. More...
 
float8 array_sum_big (anyarray x)
 This function finds the sum of the values in the array. NULLs are ignored. Return type is always FLOAT8 regardless of input. This function is meant to replace array_sum in the cases when sum may overflow the array type. More...
 
float8 array_mean (anyarray x)
 TThis function finds the mean of the values in the array. NULLs are ignored. Return type is the same as the input type. More...
 
float8 array_stddev (anyarray x)
 This function finds the standard deviation of the values in the array. NULLs are ignored. Return type is the same as the input type. More...
 
float8[] array_of_float (int4 k)
 This function creates an array of set size (the argument value) of FLOAT8, initializing the values to 0.0;. More...
 
int8[] array_of_bigint (int4 k)
 This function creates an array of set size (the argument value) of BIGINT, initializing the values to 0;. More...
 
anyarray array_fill (anyarray x, anyelement k)
 This functions set every values in the array to some desired value (provided as the argument). More...
 
anyarray array_scalar_mult (anyarray x, anyelement k)
 This function takes an array as the input and executes element with multiplication by the scalar provided as the second argument, returning the resulting array. It requires that all the values are NON-NULL. Return type is the same as the input type. More...
 
anyarray array_sqrt (anyarray x)
 This function takes an array as the input and finds square root of each element in the array, returning the resulting array. It requires that all the values are NON-NULL. Return type is the same as the input type. This means that if the input if of the size INT, the results would also be rounded. More...
 
float8[] normalize (float8[] x)
 Array normalization function. More...
 
aggregate anyarray array_agg (anyelement)
 ARRAY_AGG aggregate for compatibility with GPDB < 4.1 and Postgres < 9.0 This is a slower solution than the built in array_agg that appears in later GPDB and Postgres versions.
 

Detailed Description

Date
April 2011

Definition in file array_ops.sql_in.

Function Documentation

anyarray array_add ( anyarray  x,
anyarray  y 
)
Parameters
xArray x
yArray y
Returns
Sum of x and y.

Definition at line 67 of file array_ops.sql_in.

bool array_contains ( anyarray  x,
anyarray  y 
)
Parameters
xArray x
yArray y
Returns
Returns true if x contains y.

Definition at line 127 of file array_ops.sql_in.

anyarray array_div ( anyarray  x,
anyarray  y 
)
Parameters
xArray x
yArray y
Returns
Element-wise division of x and y.

Definition at line 103 of file array_ops.sql_in.

float8 array_dot ( anyarray  x,
anyarray  y 
)
Parameters
xArray x
yArray y
Returns
Dot-product of x and y.

Definition at line 115 of file array_ops.sql_in.

anyarray array_fill ( anyarray  x,
anyelement  k 
)
Parameters
xSome array
kDesired value
Returns
Fills array with desired value.

Definition at line 227 of file array_ops.sql_in.

anyelement array_max ( anyarray  x)
Parameters
xArray x
Returns
Max of x.

Definition at line 138 of file array_ops.sql_in.

float8 array_mean ( anyarray  x)
Parameters
xArray x
Returns
Mean of x.

Definition at line 182 of file array_ops.sql_in.

anyelement array_min ( anyarray  x)
Parameters
xArray x
Returns
Min of x.

Definition at line 149 of file array_ops.sql_in.

anyarray array_mult ( anyarray  x,
anyarray  y 
)
Parameters
xArray x
yArray y
Returns
Element-wise product of x and y.

Definition at line 91 of file array_ops.sql_in.

int8 [] array_of_bigint ( int4  k)
Parameters
kArray size.
Returns
Array of size k.

Definition at line 215 of file array_ops.sql_in.

float8 [] array_of_float ( int4  k)
Parameters
kArray size
Returns
Array of size k.

Definition at line 204 of file array_ops.sql_in.

anyarray array_scalar_mult ( anyarray  x,
anyelement  k 
)
Parameters
xArray x
kScalar
Returns
Array with each element of x multiplied by scalar.

Definition at line 238 of file array_ops.sql_in.

anyarray array_sqrt ( anyarray  x)
Parameters
xArray x
Returns
Square root of all elements of x.

Definition at line 249 of file array_ops.sql_in.

float8 array_stddev ( anyarray  x)
Parameters
xArray x
Returns
Standard deviation of x.

Definition at line 193 of file array_ops.sql_in.

anyarray array_sub ( anyarray  x,
anyarray  y 
)
Parameters
xArray x
yArray y
Returns
x-y.

Definition at line 79 of file array_ops.sql_in.

anyelement array_sum ( anyarray  x)
Parameters
xArray x
Returns
Sum of x.

Definition at line 160 of file array_ops.sql_in.

float8 array_sum_big ( anyarray  x)
Parameters
xArray x
Returns
Sum of x.

Definition at line 171 of file array_ops.sql_in.

float8 [] normalize ( float8[]  x)
Parameters
xArray x.
Returns
Array normalized by its norm.

Definition at line 261 of file array_ops.sql_in.