Postgresql Create Sequence Start With Select Max Over Partition