Skip to content

Conversation

@ChristopherCailombus
Copy link

  1. changed the assertion name to include the parent and child keys. This allows referential integrity checks where the child table may have multiple columns referencing the same parent column. Previously this would have given a duplicate declaration name error.

  2. changed the select statement from a left join to a right join, and filtering on where parent key is null. The previous left join and filtering on child key returns only rows in parents that do not exist in child. However, this does not mean that the rows in child are also in parent. Therefore this was not a true referential integrity check. Referential integrity check should check to make sure that every child value exists in the parent values.

1. changed the assertion name to include the parent and child keys. This allows referential integrity checks where the child table may have multiple columns referencing the same parent column. Previously this would have given a duplicate declaration name error.

2. changed the select statement from a left join to a right join, and filtering on where parent key is null. The previous left join and filtering on child key returns only rows in parents that do not exist in child. However, this does not mean that the rows in child are also in parent. Therefore this was not a true referential integrity check. Referential integrity check should check to make sure that every child value exists in the parent values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant