Your requirement is a little difficult to understand. It seems you want a unique ID value per unique string value, but not unique across the entire data set, i.e. if you have ABCDEF multiple times in the data set, the integer value will be the same across them.
If so, you can use the DENSE_RANK() function to produce an incrementing integer id grouped based on the non-unique strings. Example below:
CREATE TABLE DataTable (NonUniqueString VARCHAR(25))
INSERT INTO DataTable
VALUES ('ABCDEF'), ('GHIJKL'), ('ABCDEF'), ('GHIJKL'), ('ABCDEF')
SELECT NonUniqueString,
DENSE_RANK() OVER (ORDER BY NonUniqueString) AS "Group"
FROM DataTable
Results:
NonUniqueString Group
-------------------------
ABCDEF 1
ABCDEF 1
ABCDEF 1
GHIJKL 2
GHIJKL 2
NOTE: The example was from MS SQL Server but the DENSE_RANK() function should behave the same in PostgreSQL and uses the same syntax.