Skip to content

Instantly share code, notes, and snippets.

@yujihamaguchi
Last active August 29, 2015 14:04
Show Gist options
  • Save yujihamaguchi/41a4056b87a1f2dd3c58 to your computer and use it in GitHub Desktop.
Save yujihamaguchi/41a4056b87a1f2dd3c58 to your computer and use it in GitHub Desktop.
[Redshift] テーブル名と制約名の紐付け一覧
SELECT
(SELECT relname FROM pg_class r2 WHERE r2.oid = r1.conrelid) AS table_name
,conname AS constraint_name
FROM
pg_constraint r1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment