Postgres Split String To Array Python Questions For If Statement