Postgresql Get Index Of Row