pgtap icon indicating copy to clipboard operation
pgtap copied to clipboard

Add has_check() Variants

Open theory opened this issue 12 years ago • 4 comments

has_check() is currently quite limited. It should be updated to have the same interface as has_index().

theory avatar Jan 21 '13 23:01 theory

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

theory avatar Jan 21 '13 23:01 theory

A request for renewed interest in getting this enchancement. Could use it for constraint stuff in pg_partman.

keithf4 avatar Feb 05 '14 21:02 keithf4

Got a pull request?

theory avatar Feb 05 '14 21:02 theory

Wish I had the time. Just letting you know there is interest in this feature. :)

keithf4 avatar Feb 05 '14 22:02 keithf4