Custom sequence in postgresql