Cascade FOREIGN KEYS in Redshift


#1

Hi there,

I would like to understand why the foreign keys in Redshift are not set to cascade?

When i delete events, I would like all relating data to be deleted as well.

Enrico


#2

Foreign keys (along with some other constraints) aren’t enforced by Redshift.


#3

Thanks. We reprocessed some logs and have to deal with duplicated events now.

Are there any good ways of cleaning this up? I was under the impression events that already exists will not be imported again.

Enrico


#4

The guide that @christophe has written here is probably the most comprehensive docs on deduplication (both pre EMR and post EMR).


#5

Further to @mike’s points - there is no CASCADE in Redshift constraints:

http://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_TABLE_NEW.html