Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT DISTINCT ON(cls.relname)
- cls.oid,
- cls.relname as idxname,
- indkey,
- indisunique,
- CASE WHEN (SELECT contype FROM pg_constraint
- WHERE conname=cls.relname
- AND conrelid=349515) = 'u'
- THEN true ELSE false END AS indisconstr
- FROM pg_index idx
- JOIN pg_class cls ON cls.oid=indexrelid
- WHERE indrelid = 349515 AND NOT indisprimary
- ORDER BY cls.relname
Add Comment
Please, Sign In to add comment