pgtap
pgtap copied to clipboard
Add has_check() Variants
has_check() is currently quite limited. It should be updated to have the same interface as has_index().
There should be a check_ok() function, too. It should be similar to fk_ok(). Query to get started:
SELECT pg_catalog.pg_get_constraintdef(r.oid, true)
FROM pg_catalog.pg_namespace n
JOIN pg_catalog.pg_class c ON n.oid = c.relnamespace
JOIN pg_catalog.pg_constraint x ON c.oid = x.conrelid
WHERE n.nspname = $1
AND c.relname = $2
AND x.contype = 'c'
AND x.conname = $3
A request for renewed interest in getting this enchancement. Could use it for constraint stuff in pg_partman.
Got a pull request?
Wish I had the time. Just letting you know there is interest in this feature. :)