I am working on a redshift project, I don't want to load a row 2 times and redshift is not enforcing any constraints. Is there any other way to do this?
Asked
Active
Viewed 1,174 times
1
-
If you can be interested in after-load solutions, here is a question about removing dupes: https://stackoverflow.com/questions/37582261/deleting-duplicates-rows-from-redshift – vahdet Jul 10 '18 at 09:15
-
Thank you...so,there is no other way to prevent duplicate entries on the table level like constraints. – KarthiK Jul 10 '18 at 09:33
-
1Try loading your data into a staging table, then filter out duplicates in a query (i.e. an anti-join). You can get an exact copy of the DDL for you table with a solution that AWS put together. https://github.com/awslabs/amazon-redshift-utils/blob/master/src/AdminViews/v_generate_tbl_ddl.sql – Mikuana Jul 11 '18 at 02:48