Hi,
Is there an INSERT IGNORE option in Vertica? It's a MySQL feature that will let an insert run without error if there is a PK or UK violation.
INSERT IGNORE
Moderator: NorbertKrupa
-
- Intermediate
- Posts: 96
- Joined: Thu Jul 19, 2012 12:33 am
Re: INSERT IGNORE
Brett, you are in luck! Vertica doesn't error when you insert records that violate a primary or unique key
Make sure to check for table dups or handle (i.e. eliminate) them in the ETL process. That's what we do now!
Make sure to check for table dups or handle (i.e. eliminate) them in the ETL process. That's what we do now!
Thanks,
Harry
Harry
Re: INSERT IGNORE
#Brett,
You can use either Insert / COPY statement to load data into Vertica.
Either way you load data, Vertica will not throw any constraint violation error, even though you have primary keys and foreign keys defined on tables.
The only point when the table will give a Constraint Violation error is when the two tables having referential relation will be joined with each other on their Primary and Foreign keys.
Hope this helps..
You can use either Insert / COPY statement to load data into Vertica.
Either way you load data, Vertica will not throw any constraint violation error, even though you have primary keys and foreign keys defined on tables.
The only point when the table will give a Constraint Violation error is when the two tables having referential relation will be joined with each other on their Primary and Foreign keys.
Hope this helps..
Re: INSERT IGNORE
@nnani: This is not correct. Before commiting the new data loaded, you can run ANALYZE_CONSTRAINTS() to ask the engine to check constraint violations.
Check this thread:
viewtopic.php?f=48&t=845
Check this thread:
viewtopic.php?f=48&t=845