I have an PostgreSQL server with an existing table which has an fixed-width-non-unique-string column such as this:
| ID_STRING |
| 'ABCDEFG' |
| 'HIJKLMN' |
Now I want to compute unique integer ids for each element and store them into an additional column. The result should look like this:
| ID_STRING | ID_INT
| 'ABCDEFG' | 1
| 'HIJKLMN' | 2
| 'ABCDEFG' | 1
| 'HIJKLMN' | 2
Is there an easy way to achieve this?