Postgresql Get Index Of Arraylist