get last element postgresql with index code example Example: postgresql array last element arr[array_length(arr, 1)]