ロール作成
create role [ロール名] with login password [パスワード]
create role postgres_dev with login password postgres_dev
管理者権限付与
grant postgres to [ロール名]
grant postgres to postgres_dev
ロールにスキーマを付与
grant usage on schema [スキーマ名] to [ロール名]
grant usage on schema tym to postgres_dev
なんかスキーマに権限付与
revoke create on schema [スキーマ名] from public;
revoke create on schema tym from public;
外部キーの取得
select *
from infomation_schema.table_constraints
where constraint_type = 'FOREIGN KEY'