schemainspect icon indicating copy to clipboard operation
schemainspect copied to clipboard

Add support for exclusion constraints

Open trendels opened this issue 4 years ago • 1 comments

This should fix djrobstep/migra#147

Unfortunately this required some special casing of exclusion constraints in the SQL generation functions.

Exclusion constraints don't show up in information_schema.table_constraints, so remove that table from the constraints query, and use the equivalent fields from pg_constraint directly.

Also, the "USING INDEX" form is not available when creating an exclusion constraint. The index is always created implicitly. Instead of a "CREATE INDEX" statement, emit a dummy statement ("select 1;") for indexes that belong to exclusion constraints.

trendels avatar Jan 21 '21 22:01 trendels

Awesome, thanks so much for contributing this! Have given it a brief lookover and all looks good, can hopefully give it a more detailed review later today and then merge.

djrobstep avatar Jan 21 '21 23:01 djrobstep

This code, with some minor mods, is now added. Thanks so much for contributing this!

djrobstep avatar Sep 18 '22 06:09 djrobstep