The same kind of error, prompted if the combination of dimensions set as key columns (primary keys) is providing more than one row of data within an extract, can have different phrasings for each database type. It could be either of
- duplicate key value violates unique constraint
- could not create unique index
- or similar
In this example the columns in yellow are marked set to key columns (primary key in your database). All three columns have identical combination of values (ABC & Co.; Spring 2018; Ad-001-spring) leading to more than one row with the same primary key. In this case the database doesn't know which row to save - the first or the second one.
Solution in the example above would be to include the column Size as a key column because this column makes it possible to distinguishing the two data-sets.
In cases when there is no additional column available to distinguish the data sets, it's required to aggregate the metrics like in this example:
If there is a change in key columns you need to drop (delete) the table the target destination and re-import all data. Dropping the table would not only remove the data but also removes the primary key selection and constraints. Only then it is possible to import data with the new combination of primary keys (key columns)