Create unique id field for a view in PostgreSQL