Postgres Row Number Partition By In Redshift